﻿
  CREATE TABLE "EISP"."T_ALERT_CODE" 
   (	"ID" NUMBER(10,0) NOT NULL ENABLE, 
	"ALERT_CODE" VARCHAR2(5 BYTE), 
	"ALERT_MESSAGE" VARCHAR2(1000 BYTE), 
	"PROTOCOL_TYPE" VARCHAR2(2 BYTE), 
	 CONSTRAINT "T_ALERT_CODE_PK" PRIMARY KEY ("ID")
  USING INDEX PCTFREE 10 INITRANS 2 MAXTRANS 255 COMPUTE STATISTICS 
  STORAGE(INITIAL 65536 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645
  PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1 BUFFER_POOL DEFAULT)
  TABLESPACE "EISP"  ENABLE
   ) PCTFREE 10 PCTUSED 40 INITRANS 1 MAXTRANS 255 NOCOMPRESS LOGGING
  STORAGE(INITIAL 65536 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645
  PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1 BUFFER_POOL DEFAULT)
  TABLESPACE "EISP" ;
 

   COMMENT ON COLUMN "EISP"."T_ALERT_CODE"."ALERT_CODE" IS '(广东协议)报警编码
0101 窃电
0181 窃电恢复
0102 计量装置门打开
0182 计量装置门打开
0103 差动报警
0183 差动报警恢复
0109 电流回路逆相序
0189 电流回路逆相序恢复
010A 电压回路逆相序
018A 电压回路逆相序恢复
0111 A 相CT 一次侧短路
0191 A 相CT 一次侧短路恢复
0112 B 相CT 一次侧短路
0192 B 相CT 一次侧短路恢复
0113 C 相CT 一次侧短路
0193 C 相CT 一次侧短路恢复
0114 A 相CT 二次侧短路
0194 A 相CT 二次侧短路恢复
0115 B 相CT 二次侧短路
0195 B 相CT 二次侧短路恢复
等等，请参考对应文档



湖南协议报警编码
ERC1：数据初始化和版本变更记录
ERC2：参数丢失记录
ERC3：参数变更记录
ERC4：状态量变位记录
ERC5：遥控跳闸记录
ERC6：功控跳闸记录
ERC7：电控跳闸记录
ERC8：电能表参数变更
ERC9：电流回路异常
ERC10：电压回路异常
ERC11：相序异常
ERC12：电能表时间超差
ERC13：电表故障信息
ERC14：终端停/上电事件
ERC15：谐波越限告警
ERC16：直流模拟量越限记录
ERC17：电压/电流不平衡度越限记录
ERC18：电容器投切自锁记录
ERC19：购电参数设置记录
ERC20：消息认证错误记录
ERC21：终端故障记录
ERC22：有功总电能量差动越限事件记录
ERC23：电控告警事件记录
ERC24：电压越限记录
ERC25：电流越限记录
ERC26：视在功率越限记录
ERC27：电能表示度下降记录
ERC28：电能量超差记录
ERC29：电能表飞走记录
ERC30：电能表停走记录
ERC31：485抄表失败事件记录
ERC32：终端与主站通信流量超门限事件记录';
 
   COMMENT ON COLUMN "EISP"."T_ALERT_CODE"."PROTOCOL_TYPE" IS '协议类型
1：广东协议
2：湖南协议';
 
   COMMENT ON TABLE "EISP"."T_ALERT_CODE"  IS '告警时间编码表';
 

  CREATE TABLE "EISP"."T_ALERT_DETAIL" 
   (	"ID" NUMBER(10,0) NOT NULL ENABLE, 
	"ALERT_CODE_ID" NUMBER(10,0), 
	"ALERT_PARAMETER" VARCHAR2(1000 BYTE), 
	"ALERT_TIME" TIMESTAMP (6), 
	"ALERT_OPERATOR" VARCHAR2(20 BYTE), 
	"ALERT_OPERATER_TIME" TIMESTAMP (6), 
	"PROTOCOL_TYPE" VARCHAR2(2 BYTE), 
	"ALERT_ADVICE" VARCHAR2(1000 BYTE), 
	"ALERT_SOURCE" VARCHAR2(16 BYTE), 
	 CONSTRAINT "T_ALERT_DETAIL_PK" PRIMARY KEY ("ID")
  USING INDEX PCTFREE 10 INITRANS 2 MAXTRANS 255 COMPUTE STATISTICS 
  STORAGE(INITIAL 65536 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645
  PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1 BUFFER_POOL DEFAULT)
  TABLESPACE "EISP"  ENABLE, 
	 CONSTRAINT "AD_AC_FK" FOREIGN KEY ("ALERT_CODE_ID")
	  REFERENCES "EISP"."T_ALERT_CODE" ("ID") ENABLE
   ) PCTFREE 10 PCTUSED 40 INITRANS 1 MAXTRANS 255 NOCOMPRESS LOGGING
  STORAGE(INITIAL 65536 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645
  PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1 BUFFER_POOL DEFAULT)
  TABLESPACE "EISP" ;
 

   COMMENT ON COLUMN "EISP"."T_ALERT_DETAIL"."ALERT_PARAMETER" IS '告警参数（告警时间消息报中解析出来的参数）';
 
   COMMENT ON COLUMN "EISP"."T_ALERT_DETAIL"."ALERT_TIME" IS '告警时间产生时间（从报警报中解析出来的告警时间时间）';
 
   COMMENT ON COLUMN "EISP"."T_ALERT_DETAIL"."ALERT_OPERATOR" IS '告警时间处理人';
 
   COMMENT ON COLUMN "EISP"."T_ALERT_DETAIL"."ALERT_OPERATER_TIME" IS '告警时间处理时间';
 
   COMMENT ON COLUMN "EISP"."T_ALERT_DETAIL"."PROTOCOL_TYPE" IS '协议类型
1：广东协议
2：湖南协议';
 
   COMMENT ON COLUMN "EISP"."T_ALERT_DETAIL"."ALERT_ADVICE" IS '告警事件处理意见';
 
   COMMENT ON COLUMN "EISP"."T_ALERT_DETAIL"."ALERT_SOURCE" IS '引起报警事件的终端的ID置(如集中器引起的告警，id为集中器的id)';
 

  CREATE TABLE "EISP"."T_AUTO_TASK" 
   (	"ID" NUMBER(10,0) NOT NULL ENABLE, 
	"AT_TASK_TYPE" VARCHAR2(2 BYTE), 
	"MP_ID" NUMBER(10,0), 
	"AT_RUN_DATE" TIMESTAMP (6), 
	"AT_FREEZE_CYCLE" NUMBER(5,0), 
	"AT_ALLCOLLECT_COUNT" NUMBER(10,0), 
	"AT_COLLECT_COUNT" NUMBER(10,0), 
	"AT_TASK_BUILD_DATE" TIMESTAMP (6), 
	"AT_TASK_TERMINATE_DATE" TIMESTAMP (6), 
	"GROUP_ID" NUMBER(10,0), 
	"CON_ID" NUMBER(10,0), 
	"AT_LAST_RUN_DATE" TIMESTAMP (6), 
	"AT_MIN_RUN_STEP" NUMBER(5,0), 
	"AT_RUN_TIMES" NUMBER(5,0), 
	"AT_TASK_STATUS" VARCHAR2(32 BYTE), 
	"AT_PRI" NUMBER(5,0), 
	"AT_TASK_SOURCE" VARCHAR2(100 BYTE), 
	"AT_COLLECT_TIMES" NUMBER(5,0), 
	"AT_MAX_COM_SUCC_NUM" NUMBER(3,0), 
	"AT_COMM_SUCC_NUM" NUMBER(3,0), 
	 CONSTRAINT "T_AUTO_TASK_PK" PRIMARY KEY ("ID")
  USING INDEX PCTFREE 10 INITRANS 2 MAXTRANS 255 COMPUTE STATISTICS 
  STORAGE(INITIAL 65536 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645
  PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1 BUFFER_POOL DEFAULT)
  TABLESPACE "EISP"  ENABLE, 
	 CONSTRAINT "AT_CON_FK" FOREIGN KEY ("CON_ID")
	  REFERENCES "EISP"."T_CONCENTRATOR" ("ID") ON DELETE CASCADE ENABLE, 
	 CONSTRAINT "AT_G_FK" FOREIGN KEY ("GROUP_ID")
	  REFERENCES "EISP"."T_GROUP" ("ID") ON DELETE CASCADE ENABLE
   ) PCTFREE 10 PCTUSED 40 INITRANS 1 MAXTRANS 255 NOCOMPRESS LOGGING
  STORAGE(INITIAL 65536 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645
  PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1 BUFFER_POOL DEFAULT)
  TABLESPACE "EISP" ;
 

   COMMENT ON COLUMN "EISP"."T_AUTO_TASK"."ID" IS '任务流水号';
 
   COMMENT ON COLUMN "EISP"."T_AUTO_TASK"."AT_TASK_TYPE" IS '任务类型(1：当前2：重点户时冻结电量3：日冻结电量 4：月冻结电量 5：年冻结电量 6:大用户瞬时量 7:负荷曲线数据 8:总表日冻结 )';
 
   COMMENT ON COLUMN "EISP"."T_AUTO_TASK"."MP_ID" IS '测量点号';
 
   COMMENT ON COLUMN "EISP"."T_AUTO_TASK"."AT_RUN_DATE" IS '抄读日期';
 
   COMMENT ON COLUMN "EISP"."T_AUTO_TASK"."AT_FREEZE_CYCLE" IS '冻结周期(分钟)';
 
   COMMENT ON COLUMN "EISP"."T_AUTO_TASK"."AT_ALLCOLLECT_COUNT" IS '应抄数';
 
   COMMENT ON COLUMN "EISP"."T_AUTO_TASK"."AT_COLLECT_COUNT" IS '应抄数';
 
   COMMENT ON COLUMN "EISP"."T_AUTO_TASK"."AT_TASK_BUILD_DATE" IS '任务创建时间';
 
   COMMENT ON COLUMN "EISP"."T_AUTO_TASK"."AT_TASK_TERMINATE_DATE" IS '任务终止时间';
 
   COMMENT ON COLUMN "EISP"."T_AUTO_TASK"."GROUP_ID" IS '台区编号';
 
   COMMENT ON COLUMN "EISP"."T_AUTO_TASK"."CON_ID" IS '集中器编号';
 
   COMMENT ON COLUMN "EISP"."T_AUTO_TASK"."AT_LAST_RUN_DATE" IS '最近一次抄读时间';
 
   COMMENT ON COLUMN "EISP"."T_AUTO_TASK"."AT_MIN_RUN_STEP" IS '抄读最小间隔(分钟)';
 
   COMMENT ON COLUMN "EISP"."T_AUTO_TASK"."AT_RUN_TIMES" IS '抄读次数';
 
   COMMENT ON COLUMN "EISP"."T_AUTO_TASK"."AT_TASK_STATUS" IS '任务状态说明  varchar2（32）缺省为全‘0’，分为 采集和计算
从左 －>>右，第n个字符含义依次代表：

1. 采集任务状态(0=缺数;1=缺数计算;2=完成;3=超时),
2. 日电量计算状态(0=待算;1=正在计算;2=完成;3=超时;4=上次缺数),
3. 月电量计算状态
4. 年电量计算状态
5. 日线损计算状态
6. 月线损计算状态
7. 年线损计算状态';
 
   COMMENT ON COLUMN "EISP"."T_AUTO_TASK"."AT_PRI" IS '优先级(1最高)';
 
   COMMENT ON COLUMN "EISP"."T_AUTO_TASK"."AT_TASK_SOURCE" IS '任务来源(1=自动;2=人工)';
 
   COMMENT ON COLUMN "EISP"."T_AUTO_TASK"."AT_COLLECT_TIMES" IS '最大采集次数';
 
   COMMENT ON COLUMN "EISP"."T_AUTO_TASK"."AT_MAX_COM_SUCC_NUM" IS '最大通信成功次数';
 
   COMMENT ON COLUMN "EISP"."T_AUTO_TASK"."AT_COMM_SUCC_NUM" IS '通信成功次数';
 
   COMMENT ON TABLE "EISP"."T_AUTO_TASK"  IS '日冻结抄读任务表';
 

  CREATE OR REPLACE TRIGGER "EISP"."T_AUTO_TASK_TG" 
  before insert on T_AUTO_TASK
  for each row
begin
  IF :NEW.id is NULL THEN
    SELECT T_AUTO_TASK_SEQ.NEXTVAL INTO :NEW.id FROM dual;
  END IF;
end T_AUTO_TASK_TG;


/
ALTER TRIGGER "EISP"."T_AUTO_TASK_TG" ENABLE;
 

  CREATE TABLE "EISP"."T_BUFFER_LOG" 
   (	"BL_SOURCE_ADDR" VARCHAR2(16 BYTE), 
	"BL_DEST_ADDR" VARCHAR2(16 BYTE), 
	"BL_SEND_DATE" TIMESTAMP (6), 
	"ID" NUMBER(10,0) NOT NULL ENABLE, 
	"BL_BUFFER_CONTENT" CLOB, 
	 CONSTRAINT "BL_PK" PRIMARY KEY ("ID")
  USING INDEX PCTFREE 10 INITRANS 2 MAXTRANS 255 COMPUTE STATISTICS 
  STORAGE(INITIAL 65536 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645
  PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1 BUFFER_POOL DEFAULT)
  TABLESPACE "EISP"  ENABLE
   ) PCTFREE 10 PCTUSED 40 INITRANS 1 MAXTRANS 255 NOCOMPRESS LOGGING
  STORAGE(INITIAL 65536 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645
  PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1 BUFFER_POOL DEFAULT)
  TABLESPACE "EISP" 
 LOB ("BL_BUFFER_CONTENT") STORE AS (
  TABLESPACE "EISP" ENABLE STORAGE IN ROW CHUNK 8192 PCTVERSION 10
  NOCACHE LOGGING 
  STORAGE(INITIAL 65536 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645
  PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1 BUFFER_POOL DEFAULT)) ;
 

   COMMENT ON COLUMN "EISP"."T_BUFFER_LOG"."BL_SOURCE_ADDR" IS '??？？?？?';
 
   COMMENT ON COLUMN "EISP"."T_BUFFER_LOG"."BL_DEST_ADDR" IS '??？？?？？';
 
   COMMENT ON COLUMN "EISP"."T_BUFFER_LOG"."BL_SEND_DATE" IS '??？？?';
 

  CREATE OR REPLACE TRIGGER "EISP"."T_BUFFER_LOG_TG" 
  before insert on T_BUFFER_LOG
  for each row
begin
  IF :NEW.id is NULL THEN
    SELECT T_BUFFER_LOG_SEQ.NEXTVAL INTO :NEW.id FROM DUAL;
  END IF;
end T_BUFFER_LOG_TG;


/
ALTER TRIGGER "EISP"."T_BUFFER_LOG_TG" ENABLE;
 

  CREATE TABLE "EISP"."T_CALC_TASK" 
   (	"ID" NUMBER(10,0) NOT NULL ENABLE, 
	"TASK_TYPE" VARCHAR2(2 BYTE), 
	"TARGET_TYPE" VARCHAR2(2 BYTE), 
	"TARGET_ID" NUMBER(10,0), 
	"STATUS" VARCHAR2(2 BYTE), 
	"TASK_SOURCE" VARCHAR2(2 BYTE), 
	"TASK_DATE" TIMESTAMP (6), 
	"TASK_CREATE_DATE" TIMESTAMP (6), 
	 CONSTRAINT "T_CALE_TASK_PK" PRIMARY KEY ("ID")
  USING INDEX PCTFREE 10 INITRANS 2 MAXTRANS 255 COMPUTE STATISTICS 
  STORAGE(INITIAL 65536 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645
  PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1 BUFFER_POOL DEFAULT)
  TABLESPACE "EISP"  ENABLE
   ) PCTFREE 10 PCTUSED 40 INITRANS 1 MAXTRANS 255 NOCOMPRESS LOGGING
  STORAGE(INITIAL 65536 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645
  PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1 BUFFER_POOL DEFAULT)
  TABLESPACE "EISP" ;
 

   COMMENT ON COLUMN "EISP"."T_CALC_TASK"."TASK_TYPE" IS '任务类型
1：用电量
2：线损';
 
   COMMENT ON COLUMN "EISP"."T_CALC_TASK"."TARGET_TYPE" IS '自动计算目标对象类型
自动计算目标对象类型
5：台区
10：集中器
15：总表
20：居民表';
 
   COMMENT ON COLUMN "EISP"."T_CALC_TASK"."TARGET_ID" IS '自动计算任务的目标对象id';
 
   COMMENT ON COLUMN "EISP"."T_CALC_TASK"."STATUS" IS '任务状态
0：完成
1：未完成';
 
   COMMENT ON COLUMN "EISP"."T_CALC_TASK"."TASK_SOURCE" IS '任务来源
0：手工
1：自动';
 
   COMMENT ON COLUMN "EISP"."T_CALC_TASK"."TASK_DATE" IS '任务产生日期(也可以理解为任务要计算那天的数据)';
 
   COMMENT ON COLUMN "EISP"."T_CALC_TASK"."TASK_CREATE_DATE" IS '任务创建日期';
 
   COMMENT ON TABLE "EISP"."T_CALC_TASK"  IS '计算任务表';
 

  CREATE OR REPLACE TRIGGER "EISP"."T_CALE_TASK_TG" 
  before insert on T_CALC_TASK
  for each row
begin
   SELECT T_CALE_TASK_SEQ.NEXTVAL INTO :NEW.id FROM DUAL;
end T_CALE_TASK_TG;


/
ALTER TRIGGER "EISP"."T_CALE_TASK_TG" ENABLE;
 

  CREATE TABLE "EISP"."T_CHANGE_CPT" 
   (	"ID" NUMBER(10,0) NOT NULL ENABLE, 
	"M_ID" NUMBER(10,0), 
	"M_TYPE" VARCHAR2(2 BYTE), 
	"CC_TYPE" VARCHAR2(2 BYTE), 
	"CC_DATE" TIMESTAMP (6) NOT NULL ENABLE, 
	"CC_OLD_VAL" NUMBER(10,2), 
	"CREATE_DATE" TIMESTAMP (6) NOT NULL ENABLE, 
	"CREATE_BY" VARCHAR2(20 BYTE) NOT NULL ENABLE, 
	"LAST_EDIT_DATE" TIMESTAMP (6) NOT NULL ENABLE, 
	"LAST_EDIT_BY" VARCHAR2(32 BYTE) NOT NULL ENABLE, 
	 CONSTRAINT "T_CHANGE_CPT_PK" PRIMARY KEY ("ID")
  USING INDEX PCTFREE 10 INITRANS 2 MAXTRANS 255 COMPUTE STATISTICS 
  STORAGE(INITIAL 65536 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645
  PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1 BUFFER_POOL DEFAULT)
  TABLESPACE "EISP"  ENABLE
   ) PCTFREE 10 PCTUSED 40 INITRANS 1 MAXTRANS 255 NOCOMPRESS LOGGING
  STORAGE(INITIAL 65536 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645
  PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1 BUFFER_POOL DEFAULT)
  TABLESPACE "EISP" ;
 

   COMMENT ON COLUMN "EISP"."T_CHANGE_CPT"."M_ID" IS '电表ID(包括总表和居民表)';
 
   COMMENT ON COLUMN "EISP"."T_CHANGE_CPT"."M_TYPE" IS '(电表类型 0：总表 1：居民表)';
 
   COMMENT ON COLUMN "EISP"."T_CHANGE_CPT"."CC_TYPE" IS '换CT/PT类型（0： CT  1：PT）';
 
   COMMENT ON COLUMN "EISP"."T_CHANGE_CPT"."CC_DATE" IS ' 换CT/PT时间';
 
   COMMENT ON COLUMN "EISP"."T_CHANGE_CPT"."CC_OLD_VAL" IS ' CT/PT原值';
 
   COMMENT ON TABLE "EISP"."T_CHANGE_CPT"  IS '换CT/PT信息表';
 

  CREATE TABLE "EISP"."T_CHANGE_METER" 
   (	"ID" NUMBER(10,0) NOT NULL ENABLE, 
	"M_ID" NUMBER(10,0), 
	"M_TYPE" VARCHAR2(2 BYTE), 
	"CM_DATE" TIMESTAMP (6), 
	"CREATE_DATE" TIMESTAMP (6) NOT NULL ENABLE, 
	"CREATE_BY" VARCHAR2(20 BYTE) NOT NULL ENABLE, 
	"LAST_EDIT_DATE" TIMESTAMP (6) NOT NULL ENABLE, 
	"LAST_EDIT_BY" VARCHAR2(20 BYTE) NOT NULL ENABLE, 
	 CONSTRAINT "T_CHANGE_METER_PK" PRIMARY KEY ("ID")
  USING INDEX PCTFREE 10 INITRANS 2 MAXTRANS 255 COMPUTE STATISTICS 
  STORAGE(INITIAL 65536 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645
  PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1 BUFFER_POOL DEFAULT)
  TABLESPACE "EISP"  ENABLE
   ) PCTFREE 10 PCTUSED 40 INITRANS 1 MAXTRANS 255 NOCOMPRESS LOGGING
  STORAGE(INITIAL 65536 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645
  PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1 BUFFER_POOL DEFAULT)
  TABLESPACE "EISP" ;
 

   COMMENT ON COLUMN "EISP"."T_CHANGE_METER"."M_ID" IS '电表ID(包括总表和居民表)';
 
   COMMENT ON COLUMN "EISP"."T_CHANGE_METER"."M_TYPE" IS '(电表类型 0：总表 1：居民表)';
 
   COMMENT ON COLUMN "EISP"."T_CHANGE_METER"."CM_DATE" IS '换表时间';
 
   COMMENT ON TABLE "EISP"."T_CHANGE_METER"  IS '换表信息表';
 

  CREATE TABLE "EISP"."T_CON_DETAIL" 
   (	"CON_ID" NUMBER(10,0) NOT NULL ENABLE, 
	"CD_TERM_TYPE" VARCHAR2(2 BYTE), 
	"CD_ENABLED" VARCHAR2(2 BYTE), 
	"CD_HARD_VERSION" VARCHAR2(20 BYTE), 
	"CD_SOFT_VERSION" VARCHAR2(20 BYTE), 
	"CD_IMMOBILE_TEL" VARCHAR2(20 BYTE), 
	"CD_DIAL_PARAM" VARCHAR2(20 BYTE), 
	"CD_DIAL_DELAY" NUMBER(10,0), 
	"CD_CON_IP" VARCHAR2(20 BYTE), 
	"CD_CON_PORT" VARCHAR2(20 BYTE), 
	"CD_FEP_IP" VARCHAR2(20 BYTE), 
	"CD_FEP_PORT" VARCHAR2(20 BYTE), 
	"CD_COMM_METHOD" VARCHAR2(2 BYTE), 
	"CD_CARD_NO" VARCHAR2(20 BYTE), 
	"CD_WAVE_MAKE" VARCHAR2(20 BYTE), 
	"CD_PASSWORD" VARCHAR2(20 BYTE), 
	"CREATE_DATE" TIMESTAMP (6) NOT NULL ENABLE, 
	"CREATE_BY" VARCHAR2(20 BYTE) NOT NULL ENABLE, 
	"LAST_EDIT_DATE" TIMESTAMP (6) NOT NULL ENABLE, 
	"LAST_EDIT_BY" VARCHAR2(20 BYTE) NOT NULL ENABLE, 
	"CC_RULE_TYPE" VARCHAR2(2 BYTE), 
	"CC_GM_FREEZE_GAP" NUMBER(2,0), 
	 CONSTRAINT "T_CON_DETAIL_PK" PRIMARY KEY ("CON_ID")
  USING INDEX PCTFREE 10 INITRANS 2 MAXTRANS 255 COMPUTE STATISTICS 
  STORAGE(INITIAL 65536 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645
  PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1 BUFFER_POOL DEFAULT)
  TABLESPACE "EISP"  ENABLE, 
	 CONSTRAINT "C_CD_FK" FOREIGN KEY ("CON_ID")
	  REFERENCES "EISP"."T_CONCENTRATOR" ("ID") ON DELETE CASCADE ENABLE
   ) PCTFREE 10 PCTUSED 40 INITRANS 1 MAXTRANS 255 NOCOMPRESS LOGGING
  STORAGE(INITIAL 65536 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645
  PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1 BUFFER_POOL DEFAULT)
  TABLESPACE "EISP" ;
 

   COMMENT ON COLUMN "EISP"."T_CON_DETAIL"."CD_TERM_TYPE" IS '终端类型';
 
   COMMENT ON COLUMN "EISP"."T_CON_DETAIL"."CD_ENABLED" IS '设备状态（0：不使用 1：使用）';
 
   COMMENT ON COLUMN "EISP"."T_CON_DETAIL"."CD_HARD_VERSION" IS '硬件版本';
 
   COMMENT ON COLUMN "EISP"."T_CON_DETAIL"."CD_SOFT_VERSION" IS '软件版本';
 
   COMMENT ON COLUMN "EISP"."T_CON_DETAIL"."CD_IMMOBILE_TEL" IS '固定电话';
 
   COMMENT ON COLUMN "EISP"."T_CON_DETAIL"."CD_DIAL_PARAM" IS '拨号参数';
 
   COMMENT ON COLUMN "EISP"."T_CON_DETAIL"."CD_DIAL_DELAY" IS '拨号延时';
 
   COMMENT ON COLUMN "EISP"."T_CON_DETAIL"."CD_CON_IP" IS '集中器ip
';
 
   COMMENT ON COLUMN "EISP"."T_CON_DETAIL"."CD_CON_PORT" IS '集中器端口';
 
   COMMENT ON COLUMN "EISP"."T_CON_DETAIL"."CD_FEP_IP" IS '前置机ip';
 
   COMMENT ON COLUMN "EISP"."T_CON_DETAIL"."CD_FEP_PORT" IS '前置机端口';
 
   COMMENT ON COLUMN "EISP"."T_CON_DETAIL"."CD_COMM_METHOD" IS '通讯方式（属性文件）';
 
   COMMENT ON COLUMN "EISP"."T_CON_DETAIL"."CD_CARD_NO" IS 'SIM卡号';
 
   COMMENT ON COLUMN "EISP"."T_CON_DETAIL"."CD_WAVE_MAKE" IS '载波厂家';
 
   COMMENT ON COLUMN "EISP"."T_CON_DETAIL"."CC_RULE_TYPE" IS '规约类型
1. 国电规约 ;
2. 南网规约
3. 国标COSEM';
 
   COMMENT ON COLUMN "EISP"."T_CON_DETAIL"."CC_GM_FREEZE_GAP" IS '0	不冻结	无
1	15	15分、30分、45分、0分
2	30	30分、0分；
3	60	0分
254	5	5分、10分、15分......、0分
255	1	1分、2分、3分、......0分
其它	备用		';
 
   COMMENT ON TABLE "EISP"."T_CON_DETAIL"  IS '集中器高级属性';
 

  CREATE TABLE "EISP"."T_CONCENTRATOR" 
   (	"ID" NUMBER(10,0) NOT NULL ENABLE, 
	"GROUP_ID" NUMBER(10,0), 
	"C_NAME" VARCHAR2(50 BYTE), 
	"C_LOGIC_ADDR" VARCHAR2(20 BYTE) NOT NULL ENABLE, 
	"C_MAKE" VARCHAR2(2 BYTE), 
	"C_MAKE_NO" VARCHAR2(20 BYTE), 
	"C_TYPE_NO" VARCHAR2(20 BYTE), 
	"C_INSTALL_ADDR" VARCHAR2(100 BYTE), 
	"C_INSTALL_DATE" TIMESTAMP (6), 
	"C_ASSET_NO" VARCHAR2(20 BYTE), 
	"CREATE_DATE" TIMESTAMP (6) NOT NULL ENABLE, 
	"CREATE_BY" VARCHAR2(20 BYTE) NOT NULL ENABLE, 
	"LAST_EDIT_DATE" TIMESTAMP (6) NOT NULL ENABLE, 
	"LAST_EDIT_BY" VARCHAR2(20 BYTE) NOT NULL ENABLE, 
	"C_SERIAL_NO" VARCHAR2(20 BYTE), 
	"C_SUPERVISOR" NUMBER(10,0), 
	 CONSTRAINT "T_CONCENTERATOR_PK" PRIMARY KEY ("ID")
  USING INDEX PCTFREE 10 INITRANS 2 MAXTRANS 255 COMPUTE STATISTICS 
  STORAGE(INITIAL 65536 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645
  PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1 BUFFER_POOL DEFAULT)
  TABLESPACE "EISP"  ENABLE, 
	 CONSTRAINT "G_C_FK" FOREIGN KEY ("GROUP_ID")
	  REFERENCES "EISP"."T_GROUP" ("ID") ENABLE
   ) PCTFREE 10 PCTUSED 40 INITRANS 1 MAXTRANS 255 NOCOMPRESS LOGGING
  STORAGE(INITIAL 65536 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645
  PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1 BUFFER_POOL DEFAULT)
  TABLESPACE "EISP" ;
 

   COMMENT ON COLUMN "EISP"."T_CONCENTRATOR"."C_NAME" IS '集中器名称';
 
   COMMENT ON COLUMN "EISP"."T_CONCENTRATOR"."C_LOGIC_ADDR" IS '逻辑地址';
 
   COMMENT ON COLUMN "EISP"."T_CONCENTRATOR"."C_MAKE" IS '生产厂家（属性文件）';
 
   COMMENT ON COLUMN "EISP"."T_CONCENTRATOR"."C_MAKE_NO" IS '出厂编号';
 
   COMMENT ON COLUMN "EISP"."T_CONCENTRATOR"."C_TYPE_NO" IS '型号';
 
   COMMENT ON COLUMN "EISP"."T_CONCENTRATOR"."C_INSTALL_ADDR" IS '安装地址';
 
   COMMENT ON COLUMN "EISP"."T_CONCENTRATOR"."C_INSTALL_DATE" IS '安装日期,未安装时为null';
 
   COMMENT ON COLUMN "EISP"."T_CONCENTRATOR"."C_ASSET_NO" IS '资产号';
 
   COMMENT ON COLUMN "EISP"."T_CONCENTRATOR"."C_SERIAL_NO" IS '集中器编号';
 

  CREATE TABLE "EISP"."T_D_ELEC_QUANTITY" 
   (	"ID" NUMBER(10,0) NOT NULL ENABLE, 
	"MP_ID" NUMBER(10,0), 
	"M_TYPE" VARCHAR2(2 BYTE), 
	"DEQ_DATE" TIMESTAMP (6), 
	"DEQ_PP" NUMBER(10,2), 
	"DEQ_QQ" NUMBER(10,2), 
	"DEQ_PP1" NUMBER(10,2), 
	"DEQ_QQ1" NUMBER(10,2), 
	"DEQ_PP2" NUMBER(10,2), 
	"DEQ_QQ2" NUMBER(10,2), 
	 CONSTRAINT "DEQ_PK" PRIMARY KEY ("ID")
  USING INDEX PCTFREE 10 INITRANS 2 MAXTRANS 255 COMPUTE STATISTICS 
  STORAGE(INITIAL 65536 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645
  PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1 BUFFER_POOL DEFAULT)
  TABLESPACE "EISP"  ENABLE
   ) PCTFREE 10 PCTUSED 40 INITRANS 1 MAXTRANS 255 NOCOMPRESS LOGGING
  STORAGE(INITIAL 65536 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645
  PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1 BUFFER_POOL DEFAULT)
  TABLESPACE "EISP" ;
 

   COMMENT ON COLUMN "EISP"."T_D_ELEC_QUANTITY"."MP_ID" IS '计量点号';
 
   COMMENT ON COLUMN "EISP"."T_D_ELEC_QUANTITY"."M_TYPE" IS '(电表类型 0：总表 1：居民表)';
 
   COMMENT ON COLUMN "EISP"."T_D_ELEC_QUANTITY"."DEQ_DATE" IS '日期';
 
   COMMENT ON COLUMN "EISP"."T_D_ELEC_QUANTITY"."DEQ_PP" IS '有功电量';
 
   COMMENT ON COLUMN "EISP"."T_D_ELEC_QUANTITY"."DEQ_QQ" IS '无功电量';
 
   COMMENT ON COLUMN "EISP"."T_D_ELEC_QUANTITY"."DEQ_PP1" IS '前一日总有功';
 
   COMMENT ON COLUMN "EISP"."T_D_ELEC_QUANTITY"."DEQ_QQ1" IS '前一日总无功';
 
   COMMENT ON COLUMN "EISP"."T_D_ELEC_QUANTITY"."DEQ_PP2" IS '今日总有功';
 
   COMMENT ON COLUMN "EISP"."T_D_ELEC_QUANTITY"."DEQ_QQ2" IS '近日总无功';
 
   COMMENT ON TABLE "EISP"."T_D_ELEC_QUANTITY"  IS '日电量表';
 

  CREATE OR REPLACE TRIGGER "EISP"."T_D_ELEC_QUANTITY_TG" 
  before insert on T_D_ELEC_QUANTITY
  for each row
begin
   SELECT T_D_ELEC_QUANTITY_SEQ.NEXTVAL INTO :NEW.id FROM DUAL;
end T_D_ELEC_QUANTITY_TG;


/
ALTER TRIGGER "EISP"."T_D_ELEC_QUANTITY_TG" ENABLE;
 

  CREATE TABLE "EISP"."T_D_STAT_INFO" 
   (	"ID" NUMBER(10,0) NOT NULL ENABLE, 
	"GROUP_ID" NUMBER(10,0) NOT NULL ENABLE, 
	"DSI_DATE" TIMESTAMP (6), 
	"INSTALL_DEVICE_COUNT" NUMBER(10,0), 
	"RESIDENT_COUNT" NUMBER(10,0), 
	"TERMINAL_COUNT" NUMBER(10,0), 
	"ONLINE_TERMINAL_COUNT" NUMBER(10,0), 
	"OFFLINE_TERMINAL_COUNT" NUMBER(10,0), 
	"ALL_COLLECT_COUNT" NUMBER(10,0), 
	"COLLECT_COUNT" NUMBER(10,0), 
	"LOSS_COUNT" NUMBER(10,0), 
	"OPENFLAG_METER_COUNT" NUMBER(10,0), 
	"POWEROFF_METER_COUNT" NUMBER(10,0), 
	"OFFER_ELEC_COUNT" NUMBER(10,2), 
	"SALE_ELEC_COUNT" NUMBER(10,2), 
	"LOSS_ELEC_COUNT" NUMBER(10,2), 
	"GEN_METER_CUR_DATE_VAL" NUMBER(10,2), 
	"GEN_METER_PRE_DATE_VAL" NUMBER(10,2), 
	"ALL_SALE_ELE_COUNT" NUMBER(10,2), 
	"ALL_ELE_COUNT" NUMBER(10,2), 
	 CONSTRAINT "DSI_PK" PRIMARY KEY ("ID")
  USING INDEX PCTFREE 10 INITRANS 2 MAXTRANS 255 COMPUTE STATISTICS 
  STORAGE(INITIAL 65536 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645
  PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1 BUFFER_POOL DEFAULT)
  TABLESPACE "EISP"  ENABLE, 
	 CONSTRAINT "DSI_G_FK" FOREIGN KEY ("GROUP_ID")
	  REFERENCES "EISP"."T_GROUP" ("ID") ENABLE
   ) PCTFREE 10 PCTUSED 40 INITRANS 1 MAXTRANS 255 NOCOMPRESS LOGGING
  STORAGE(INITIAL 65536 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645
  PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1 BUFFER_POOL DEFAULT)
  TABLESPACE "EISP" ;
 

   COMMENT ON COLUMN "EISP"."T_D_STAT_INFO"."DSI_DATE" IS '统计数据产生日期';
 
   COMMENT ON COLUMN "EISP"."T_D_STAT_INFO"."INSTALL_DEVICE_COUNT" IS '安装终端数';
 
   COMMENT ON COLUMN "EISP"."T_D_STAT_INFO"."RESIDENT_COUNT" IS '居民用户数';
 
   COMMENT ON COLUMN "EISP"."T_D_STAT_INFO"."TERMINAL_COUNT" IS '总终端数';
 
   COMMENT ON COLUMN "EISP"."T_D_STAT_INFO"."ONLINE_TERMINAL_COUNT" IS '上线终端数';
 
   COMMENT ON COLUMN "EISP"."T_D_STAT_INFO"."OFFLINE_TERMINAL_COUNT" IS '离线终端数';
 
   COMMENT ON COLUMN "EISP"."T_D_STAT_INFO"."ALL_COLLECT_COUNT" IS '应采集数';
 
   COMMENT ON COLUMN "EISP"."T_D_STAT_INFO"."COLLECT_COUNT" IS '采集数';
 
   COMMENT ON COLUMN "EISP"."T_D_STAT_INFO"."LOSS_COUNT" IS ' 缺数';
 
   COMMENT ON COLUMN "EISP"."T_D_STAT_INFO"."OPENFLAG_METER_COUNT" IS '拉闸用户数';
 
   COMMENT ON COLUMN "EISP"."T_D_STAT_INFO"."POWEROFF_METER_COUNT" IS '停电用户数';
 
   COMMENT ON COLUMN "EISP"."T_D_STAT_INFO"."OFFER_ELEC_COUNT" IS '供电量';
 
   COMMENT ON COLUMN "EISP"."T_D_STAT_INFO"."SALE_ELEC_COUNT" IS '售电量';
 
   COMMENT ON COLUMN "EISP"."T_D_STAT_INFO"."LOSS_ELEC_COUNT" IS '线损';
 
   COMMENT ON COLUMN "EISP"."T_D_STAT_INFO"."GEN_METER_CUR_DATE_VAL" IS '当日冻结总表码值';
 
   COMMENT ON COLUMN "EISP"."T_D_STAT_INFO"."GEN_METER_PRE_DATE_VAL" IS '总表前一日冻结总表码值';
 
   COMMENT ON COLUMN "EISP"."T_D_STAT_INFO"."ALL_SALE_ELE_COUNT" IS '售电量（用户使用的总电量）';
 
   COMMENT ON COLUMN "EISP"."T_D_STAT_INFO"."ALL_ELE_COUNT" IS '总表用电量';
 
   COMMENT ON TABLE "EISP"."T_D_STAT_INFO"  IS '日统计信息表';
 

  CREATE OR REPLACE TRIGGER "EISP"."T_D_STAT_INFO_TG" 
  before insert on T_D_STAT_INFO
  for each row
begin
  IF :NEW.id is NULL THEN
    SELECT T_D_STAT_INFO_SEQ.NEXTVAL INTO :NEW.id FROM dual;
  END IF;
end T_D_STAT_INFO_TG;


/
ALTER TRIGGER "EISP"."T_D_STAT_INFO_TG" ENABLE;
 

  CREATE TABLE "EISP"."T_ELEC_LOST_VOTAGE" 
   (	"ID" NUMBER(10,0) NOT NULL ENABLE, 
	"MP_ID" NUMBER(10,0), 
	"ELV_DATE" TIMESTAMP (6), 
	"ELV_T_S" TIMESTAMP (6), 
	"ELV_TA_S" TIMESTAMP (6), 
	"ELV_TB_S" TIMESTAMP (6), 
	"ELV_TC_S" TIMESTAMP (6), 
	"ELV_T" NUMBER(11,5), 
	"ELV_TA" NUMBER(11,5), 
	"ELV_TB" NUMBER(11,5), 
	"ELV_TC" NUMBER(11,5), 
	"ELV_EA" NUMBER(5,0), 
	"ELV_EB" NUMBER(5,0), 
	"ELV_EC" NUMBER(5,0), 
	 CONSTRAINT "ELV_PK" PRIMARY KEY ("ID")
  USING INDEX PCTFREE 10 INITRANS 2 MAXTRANS 255 COMPUTE STATISTICS 
  STORAGE(INITIAL 65536 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645
  PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1 BUFFER_POOL DEFAULT)
  TABLESPACE "EISP"  ENABLE
   ) PCTFREE 10 PCTUSED 40 INITRANS 1 MAXTRANS 255 NOCOMPRESS LOGGING
  STORAGE(INITIAL 65536 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645
  PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1 BUFFER_POOL DEFAULT)
  TABLESPACE "EISP" ;
 

   COMMENT ON COLUMN "EISP"."T_ELEC_LOST_VOTAGE"."MP_ID" IS '测量点号';
 
   COMMENT ON COLUMN "EISP"."T_ELEC_LOST_VOTAGE"."ELV_DATE" IS '数据对应时间(失压数据的产生时间)';
 
   COMMENT ON COLUMN "EISP"."T_ELEC_LOST_VOTAGE"."ELV_T_S" IS '总(断相)失压开始时间';
 
   COMMENT ON COLUMN "EISP"."T_ELEC_LOST_VOTAGE"."ELV_TA_S" IS 'A (断相)相失压开始间';
 
   COMMENT ON COLUMN "EISP"."T_ELEC_LOST_VOTAGE"."ELV_TB_S" IS 'B(断相)相失压开始时间';
 
   COMMENT ON COLUMN "EISP"."T_ELEC_LOST_VOTAGE"."ELV_TC_S" IS 'C (断相)相失压开始时间';
 
   COMMENT ON COLUMN "EISP"."T_ELEC_LOST_VOTAGE"."ELV_T" IS '总 (断相)失压累计时间';
 
   COMMENT ON COLUMN "EISP"."T_ELEC_LOST_VOTAGE"."ELV_TA" IS 'A (断相)失压累计时间';
 
   COMMENT ON COLUMN "EISP"."T_ELEC_LOST_VOTAGE"."ELV_TB" IS 'B (断相)失压累计时间';
 
   COMMENT ON COLUMN "EISP"."T_ELEC_LOST_VOTAGE"."ELV_TC" IS 'C (断相)失压累计时间';
 
   COMMENT ON COLUMN "EISP"."T_ELEC_LOST_VOTAGE"."ELV_EA" IS 'A 相失压电';
 
   COMMENT ON COLUMN "EISP"."T_ELEC_LOST_VOTAGE"."ELV_EB" IS 'B相失压电';
 
   COMMENT ON COLUMN "EISP"."T_ELEC_LOST_VOTAGE"."ELV_EC" IS 'C 相失压电';
 
   COMMENT ON TABLE "EISP"."T_ELEC_LOST_VOTAGE"  IS '电量失压数据表结构';
 

  CREATE TABLE "EISP"."T_EM_STAT_INFO" 
   (	"ID" NUMBER(10,0) NOT NULL ENABLE, 
	 CONSTRAINT "T_EM_STAT_INFO_PK" PRIMARY KEY ("ID")
  USING INDEX PCTFREE 10 INITRANS 2 MAXTRANS 255 COMPUTE STATISTICS 
  STORAGE(INITIAL 65536 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645
  PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1 BUFFER_POOL DEFAULT)
  TABLESPACE "EISP"  ENABLE
   ) PCTFREE 10 PCTUSED 40 INITRANS 1 MAXTRANS 255 NOCOMPRESS LOGGING
  STORAGE(INITIAL 65536 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645
  PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1 BUFFER_POOL DEFAULT)
  TABLESPACE "EISP" ;
 

   COMMENT ON TABLE "EISP"."T_EM_STAT_INFO"  IS '重点用户用电分析';
 

  CREATE TABLE "EISP"."T_FEEDER" 
   (	"PARENT_ID" NUMBER(10,0), 
	"TRANFORMER_SUBSTATION_ID" NUMBER(10,0), 
	"NAME" VARCHAR2(100 BYTE), 
	"TYPE" VARCHAR2(3 BYTE), 
	"VOLTAGE_GRADE" VARCHAR2(2 BYTE), 
	"CREATE_DATE" TIMESTAMP (6) NOT NULL ENABLE, 
	"CREATE_BY" VARCHAR2(20 BYTE), 
	"LAST_EDIT_DATE" TIMESTAMP (6), 
	"LAST_EDIT_BY" VARCHAR2(20 BYTE), 
	"ID" NUMBER(10,0) NOT NULL ENABLE, 
	 CONSTRAINT "T_LINE_PK" PRIMARY KEY ("ID")
  USING INDEX PCTFREE 10 INITRANS 2 MAXTRANS 255 COMPUTE STATISTICS 
  STORAGE(INITIAL 65536 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645
  PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1 BUFFER_POOL DEFAULT)
  TABLESPACE "EISP"  ENABLE, 
	 CONSTRAINT "BL_BL_FK" FOREIGN KEY ("PARENT_ID")
	  REFERENCES "EISP"."T_FEEDER" ("ID") ENABLE, 
	 CONSTRAINT "FEEDER_TS_FK" FOREIGN KEY ("TRANFORMER_SUBSTATION_ID")
	  REFERENCES "EISP"."T_TRANFORMER_SUBSTATION" ("ID") ENABLE
   ) PCTFREE 10 PCTUSED 40 INITRANS 1 MAXTRANS 255 NOCOMPRESS LOGGING
  STORAGE(INITIAL 65536 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645
  PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1 BUFFER_POOL DEFAULT)
  TABLESPACE "EISP" ;
 

  CREATE TABLE "EISP"."T_FEP_CONN_STATE" 
   (	"ID" NUMBER(10,0) NOT NULL ENABLE, 
	"FCS_LOGIN_TYPE" NUMBER(2,0), 
	"FCS_LOGIN_ID" VARCHAR2(8 BYTE), 
	"FCS_LOGIN_DESCR" VARCHAR2(100 BYTE), 
	"FCS_ONLINE_STATUS" NUMBER(2,0), 
	"FCS_IP" VARCHAR2(16 BYTE), 
	"FCS_PORT" NUMBER(5,0), 
	"FCS_SOCKET_HANDLE" NUMBER(10,0), 
	"FCS_FIRST_ONLINE_TIME" TIMESTAMP (6), 
	"FCS_LAST_ONLINE_TIME" TIMESTAMP (6), 
	"FCS_LAST_OFFLINE_TIME" TIMESTAMP (6), 
	"FCS_HEART_BEAT_SPACE" NUMBER(10,0), 
	"FCS_LAST_HEART_BEAT_TIME" TIMESTAMP (6), 
	 CONSTRAINT "FCS_PK" PRIMARY KEY ("ID")
  USING INDEX PCTFREE 10 INITRANS 2 MAXTRANS 255 COMPUTE STATISTICS 
  STORAGE(INITIAL 65536 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645
  PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1 BUFFER_POOL DEFAULT)
  TABLESPACE "EISP"  ENABLE
   ) PCTFREE 10 PCTUSED 40 INITRANS 1 MAXTRANS 255 NOCOMPRESS LOGGING
  STORAGE(INITIAL 65536 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645
  PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1 BUFFER_POOL DEFAULT)
  TABLESPACE "EISP" ;
 

   COMMENT ON COLUMN "EISP"."T_FEP_CONN_STATE"."FCS_LOGIN_TYPE" IS '登录类型(主站=0; 集中器=1)';
 
   COMMENT ON COLUMN "EISP"."T_FEP_CONN_STATE"."FCS_LOGIN_ID" IS '登录ID(主站为FEP,  集中器为A1A2)';
 
   COMMENT ON COLUMN "EISP"."T_FEP_CONN_STATE"."FCS_LOGIN_DESCR" IS '登录描述信息(可以为台区名称)';
 
   COMMENT ON COLUMN "EISP"."T_FEP_CONN_STATE"."FCS_ONLINE_STATUS" IS '在线/下线(下线=0; 在线=1)';
 
   COMMENT ON COLUMN "EISP"."T_FEP_CONN_STATE"."FCS_IP" IS ' IP地址,';
 
   COMMENT ON COLUMN "EISP"."T_FEP_CONN_STATE"."FCS_PORT" IS '端口';
 
   COMMENT ON COLUMN "EISP"."T_FEP_CONN_STATE"."FCS_SOCKET_HANDLE" IS 'Socket句柄';
 
   COMMENT ON COLUMN "EISP"."T_FEP_CONN_STATE"."FCS_FIRST_ONLINE_TIME" IS '第一次上线时间';
 
   COMMENT ON COLUMN "EISP"."T_FEP_CONN_STATE"."FCS_LAST_ONLINE_TIME" IS '最后一次上线时间';
 
   COMMENT ON COLUMN "EISP"."T_FEP_CONN_STATE"."FCS_LAST_OFFLINE_TIME" IS '最后一次下线时间,';
 
   COMMENT ON COLUMN "EISP"."T_FEP_CONN_STATE"."FCS_HEART_BEAT_SPACE" IS '心跳间隔(秒)';
 
   COMMENT ON COLUMN "EISP"."T_FEP_CONN_STATE"."FCS_LAST_HEART_BEAT_TIME" IS '上次心跳时间';
 
   COMMENT ON TABLE "EISP"."T_FEP_CONN_STATE"  IS '连接状态表';
 

  CREATE OR REPLACE TRIGGER "EISP"."T_FEP_CONN_STATE_TG" 
  before insert on T_FEP_CONN_STATE
  for each row
begin
   SELECT T_FEP_CONN_STATE_SEQ.NEXTVAL INTO :NEW.id FROM DUAL;
end T_FEP_CONN_STATE_TG;


/
ALTER TRIGGER "EISP"."T_FEP_CONN_STATE_TG" ENABLE;
 

  CREATE TABLE "EISP"."T_FEP_DATA_LOG" 
   (	"ID" NUMBER(10,0) NOT NULL ENABLE, 
	"FDL_DATE" TIMESTAMP (6), 
	"A1A2" VARCHAR2(32 BYTE), 
	"A3" VARCHAR2(8 BYTE), 
	"AFN" VARCHAR2(8 BYTE), 
	"SEQ" VARCHAR2(8 BYTE), 
	"FN_PN" VARCHAR2(1000 BYTE), 
	"DATA_FRAME" VARCHAR2(1000 BYTE), 
	 CONSTRAINT "T_FEP_DATA_LOG_PK" PRIMARY KEY ("ID")
  USING INDEX PCTFREE 10 INITRANS 2 MAXTRANS 255 COMPUTE STATISTICS 
  STORAGE(INITIAL 65536 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645
  PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1 BUFFER_POOL DEFAULT)
  TABLESPACE "EISP"  ENABLE
   ) PCTFREE 10 PCTUSED 40 INITRANS 1 MAXTRANS 255 NOCOMPRESS LOGGING
  STORAGE(INITIAL 65536 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645
  PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1 BUFFER_POOL DEFAULT)
  TABLESPACE "EISP" ;
 

   COMMENT ON COLUMN "EISP"."T_FEP_DATA_LOG"."FDL_DATE" IS '报文产生时间';
 
   COMMENT ON COLUMN "EISP"."T_FEP_DATA_LOG"."A1A2" IS '地址域A1A2';
 
   COMMENT ON COLUMN "EISP"."T_FEP_DATA_LOG"."A3" IS '地址域A3';
 
   COMMENT ON COLUMN "EISP"."T_FEP_DATA_LOG"."AFN" IS '应用功能码';
 
   COMMENT ON COLUMN "EISP"."T_FEP_DATA_LOG"."SEQ" IS '帧序号';
 
   COMMENT ON COLUMN "EISP"."T_FEP_DATA_LOG"."DATA_FRAME" IS '数据帧';
 
   COMMENT ON TABLE "EISP"."T_FEP_DATA_LOG"  IS '报文日志记录表';
 

  CREATE TABLE "EISP"."T_FREEZE_DATA" 
   (	"ID" NUMBER(10,0) NOT NULL ENABLE, 
	"FREEZE_TYPE" NUMBER(10,0) NOT NULL ENABLE, 
	"FR_DATE" TIMESTAMP (6), 
	"FD_VALUE" NUMBER(10,4), 
	"FD_STATUS" VARCHAR2(3 BYTE), 
	"MP_ID" NUMBER(10,0), 
	 CONSTRAINT "LFC_PK" PRIMARY KEY ("ID")
  USING INDEX PCTFREE 10 INITRANS 2 MAXTRANS 255 COMPUTE STATISTICS 
  STORAGE(INITIAL 65536 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645
  PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1 BUFFER_POOL DEFAULT)
  TABLESPACE "EISP"  ENABLE, 
	 CONSTRAINT "LFT_LFD_TYPE_FK" FOREIGN KEY ("FREEZE_TYPE")
	  REFERENCES "EISP"."T_FREEZE_TYPE" ("FN") ENABLE
   ) PCTFREE 10 PCTUSED 40 INITRANS 1 MAXTRANS 255 NOCOMPRESS LOGGING
  STORAGE(INITIAL 65536 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645
  PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1 BUFFER_POOL DEFAULT)
  TABLESPACE "EISP" ;
 

   COMMENT ON COLUMN "EISP"."T_FREEZE_DATA"."FD_VALUE" IS '冻结数据值';
 
   COMMENT ON COLUMN "EISP"."T_FREEZE_DATA"."FD_STATUS" IS '冻结数据状态
0:正常
-1:异常';
 
   COMMENT ON TABLE "EISP"."T_FREEZE_DATA"  IS '曲线数据表(二类数据冻结数据表)';
 

  CREATE OR REPLACE TRIGGER "EISP"."T_FREEZE_DATA_TG" 
BEFORE INSERT ON T_FREEZE_DATA
FOR EACH ROW
BEGIN
  SELECT T_FREEZE_DATA_SEQ.NEXTVAL INTO :NEW.id FROM DUAL;
END;


/
ALTER TRIGGER "EISP"."T_FREEZE_DATA_TG" ENABLE;
 

  CREATE TABLE "EISP"."T_FREEZE_TYPE" 
   (	"FN" NUMBER(10,0) NOT NULL ENABLE, 
	"PN" VARCHAR2(100 BYTE), 
	"DESCRIBE" VARCHAR2(200 BYTE), 
	"CLASSES" VARCHAR2(50 BYTE), 
	"TP" VARCHAR2(50 BYTE), 
	"GROUP_DESC" VARCHAR2(100 BYTE), 
	"COLLECT_FLAG" NUMBER(1,0), 
	 CONSTRAINT "LFT_PK" PRIMARY KEY ("FN")
  USING INDEX PCTFREE 10 INITRANS 2 MAXTRANS 255 COMPUTE STATISTICS 
  STORAGE(INITIAL 65536 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645
  PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1 BUFFER_POOL DEFAULT)
  TABLESPACE "EISP"  ENABLE
   ) PCTFREE 10 PCTUSED 40 INITRANS 1 MAXTRANS 255 NOCOMPRESS LOGGING
  STORAGE(INITIAL 65536 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645
  PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1 BUFFER_POOL DEFAULT)
  TABLESPACE "EISP" ;
 

   COMMENT ON COLUMN "EISP"."T_FREEZE_TYPE"."FN" IS '信息类标识码';
 
   COMMENT ON COLUMN "EISP"."T_FREEZE_TYPE"."PN" IS '信息点标识码';
 
   COMMENT ON COLUMN "EISP"."T_FREEZE_TYPE"."DESCRIBE" IS '冻结类型描述信息 ';
 
   COMMENT ON COLUMN "EISP"."T_FREEZE_TYPE"."CLASSES" IS '类型（日冻结、月冻结、曲线冻结数据……）';
 
   COMMENT ON COLUMN "EISP"."T_FREEZE_TYPE"."TP" IS '数据时标(数据时间戳) ';
 
   COMMENT ON COLUMN "EISP"."T_FREEZE_TYPE"."GROUP_DESC" IS '分组描述信息';
 
   COMMENT ON COLUMN "EISP"."T_FREEZE_TYPE"."COLLECT_FLAG" IS '0:不需要采集 1:需要采集';
 
   COMMENT ON TABLE "EISP"."T_FREEZE_TYPE"  IS '冻结类型表(静态表)';
 

  CREATE TABLE "EISP"."T_GENERAL_METER" 
   (	"ID" NUMBER(10,0) NOT NULL ENABLE, 
	"GM_ID" VARCHAR2(20 BYTE), 
	"GROUP_ID" NUMBER(10,0), 
	"PT_ID" NUMBER(10,0), 
	"GM_NAME" VARCHAR2(100 BYTE), 
	"GM_TYPE" VARCHAR2(2 BYTE), 
	"GM_PASSWORD_H" VARCHAR2(20 BYTE), 
	"GM_PASSWORD_M" VARCHAR2(20 BYTE), 
	"GM_PASSWORD_L" VARCHAR2(20 BYTE), 
	"CON_ID" NUMBER(10,0), 
	"GM_ASSET_NO" VARCHAR2(20 BYTE), 
	"GM_MAKE" VARCHAR2(2 BYTE), 
	"GM_INSTALL_ADDR" VARCHAR2(100 BYTE), 
	"MP_ID" NUMBER(10,0), 
	"GM_TYPE_NO" VARCHAR2(20 BYTE), 
	"GM_MAKE_NO" VARCHAR2(20 BYTE), 
	"GM_ENABLED" VARCHAR2(2 BYTE), 
	"GM_COST_RATE_TYPE" VARCHAR2(32 BYTE), 
	"CREATE_DATE" TIMESTAMP (6) NOT NULL ENABLE, 
	"CREATE_BY" VARCHAR2(20 BYTE) NOT NULL ENABLE, 
	"LAST_EDIT_DATE" TIMESTAMP (6) NOT NULL ENABLE, 
	"LAST_EDIT_BY" VARCHAR2(20 BYTE) NOT NULL ENABLE, 
	"GM_INSTALL_DATE" TIMESTAMP (6), 
	"GM_GP_NO" VARCHAR2(4 BYTE), 
	"GM_LN_NO" VARCHAR2(4 BYTE), 
	"GM_TA_ID" NUMBER(10,0), 
	"GM_TV_ID" NUMBER(10,0), 
	 CONSTRAINT "GM_PK" PRIMARY KEY ("ID")
  USING INDEX PCTFREE 10 INITRANS 2 MAXTRANS 255 COMPUTE STATISTICS 
  STORAGE(INITIAL 65536 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645
  PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1 BUFFER_POOL DEFAULT)
  TABLESPACE "EISP"  ENABLE, 
	 CONSTRAINT "T_GM_CON_ID_UN" UNIQUE ("CON_ID")
  USING INDEX PCTFREE 10 INITRANS 2 MAXTRANS 255 COMPUTE STATISTICS 
  STORAGE(INITIAL 65536 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645
  PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1 BUFFER_POOL DEFAULT)
  TABLESPACE "EISP"  ENABLE, 
	 CONSTRAINT "T_GM_MPID_UN" UNIQUE ("MP_ID")
  USING INDEX PCTFREE 10 INITRANS 2 MAXTRANS 255 COMPUTE STATISTICS 
  STORAGE(INITIAL 65536 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645
  PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1 BUFFER_POOL DEFAULT)
  TABLESPACE "EISP"  ENABLE, 
	 CONSTRAINT "GM_C_FK" FOREIGN KEY ("CON_ID")
	  REFERENCES "EISP"."T_CONCENTRATOR" ("ID") ON DELETE CASCADE ENABLE, 
	 CONSTRAINT "GM_G_FK" FOREIGN KEY ("GROUP_ID")
	  REFERENCES "EISP"."T_GROUP" ("ID") ON DELETE CASCADE ENABLE, 
	 CONSTRAINT "GM_PT_FK" FOREIGN KEY ("PT_ID")
	  REFERENCES "EISP"."T_PUBLIC_TRANSFORMER" ("ID") ENABLE, 
	 CONSTRAINT "GM_TA_TV_FK" FOREIGN KEY ("GM_TA_ID")
	  REFERENCES "EISP"."T_TA_TV" ("ID") ENABLE, 
	 CONSTRAINT "GM_TA_TV_FK1" FOREIGN KEY ("GM_TV_ID")
	  REFERENCES "EISP"."T_TA_TV" ("ID") ENABLE
   ) PCTFREE 10 PCTUSED 40 INITRANS 1 MAXTRANS 255 NOCOMPRESS LOGGING
  STORAGE(INITIAL 65536 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645
  PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1 BUFFER_POOL DEFAULT)
  TABLESPACE "EISP" ;
 

   COMMENT ON COLUMN "EISP"."T_GENERAL_METER"."GM_ID" IS '总表编号';
 
   COMMENT ON COLUMN "EISP"."T_GENERAL_METER"."GROUP_ID" IS '所属台区';
 
   COMMENT ON COLUMN "EISP"."T_GENERAL_METER"."PT_ID" IS '所属公变ID';
 
   COMMENT ON COLUMN "EISP"."T_GENERAL_METER"."GM_NAME" IS '总表名称';
 
   COMMENT ON COLUMN "EISP"."T_GENERAL_METER"."GM_TYPE" IS '表类型(0：电表 1：水表)';
 
   COMMENT ON COLUMN "EISP"."T_GENERAL_METER"."GM_PASSWORD_H" IS '电码密码 (密级_高)';
 
   COMMENT ON COLUMN "EISP"."T_GENERAL_METER"."GM_PASSWORD_M" IS '电码密码 (密级_中)';
 
   COMMENT ON COLUMN "EISP"."T_GENERAL_METER"."GM_PASSWORD_L" IS '电码密码 (密级_低)';
 
   COMMENT ON COLUMN "EISP"."T_GENERAL_METER"."CON_ID" IS '集中器ID';
 
   COMMENT ON COLUMN "EISP"."T_GENERAL_METER"."GM_ASSET_NO" IS '资产号';
 
   COMMENT ON COLUMN "EISP"."T_GENERAL_METER"."GM_MAKE" IS '生产厂家';
 
   COMMENT ON COLUMN "EISP"."T_GENERAL_METER"."GM_INSTALL_ADDR" IS '安装地址';
 
   COMMENT ON COLUMN "EISP"."T_GENERAL_METER"."MP_ID" IS '测量点号';
 
   COMMENT ON COLUMN "EISP"."T_GENERAL_METER"."GM_TYPE_NO" IS '型号（设备型号）';
 
   COMMENT ON COLUMN "EISP"."T_GENERAL_METER"."GM_MAKE_NO" IS '出厂编号';
 
   COMMENT ON COLUMN "EISP"."T_GENERAL_METER"."GM_ENABLED" IS '状态（0：不使用 1：使用）';
 
   COMMENT ON COLUMN "EISP"."T_GENERAL_METER"."GM_COST_RATE_TYPE" IS '费率类型（单费率、付费率）';
 
   COMMENT ON COLUMN "EISP"."T_GENERAL_METER"."GM_INSTALL_DATE" IS '安装日期';
 
   COMMENT ON COLUMN "EISP"."T_GENERAL_METER"."GM_GP_NO" IS '箱号';
 
   COMMENT ON COLUMN "EISP"."T_GENERAL_METER"."GM_LN_NO" IS '线路编号';
 
   COMMENT ON TABLE "EISP"."T_GENERAL_METER"  IS '总表';
 

  CREATE UNIQUE INDEX "EISP"."GM_PK" ON "EISP"."T_GENERAL_METER" ("ID") 
  PCTFREE 10 INITRANS 2 MAXTRANS 255 COMPUTE STATISTICS 
  STORAGE(INITIAL 65536 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645
  PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1 BUFFER_POOL DEFAULT)
  TABLESPACE "EISP" ;
 
  CREATE UNIQUE INDEX "EISP"."T_GM_CON_ID_UN" ON "EISP"."T_GENERAL_METER" ("CON_ID") 
  PCTFREE 10 INITRANS 2 MAXTRANS 255 COMPUTE STATISTICS 
  STORAGE(INITIAL 65536 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645
  PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1 BUFFER_POOL DEFAULT)
  TABLESPACE "EISP" ;
 
  CREATE UNIQUE INDEX "EISP"."T_GM_MPID_UN" ON "EISP"."T_GENERAL_METER" ("MP_ID") 
  PCTFREE 10 INITRANS 2 MAXTRANS 255 COMPUTE STATISTICS 
  STORAGE(INITIAL 65536 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645
  PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1 BUFFER_POOL DEFAULT)
  TABLESPACE "EISP" ;
 

  CREATE OR REPLACE TRIGGER "EISP"."T_GENERAL_METER_TG" 
  before insert on t_general_meter
  for each row
begin
   SELECT nvl(max(id),1) + 10000  INTO :NEW.mp_id FROM t_general_meter;
end t_general_meter_tg;

/
ALTER TRIGGER "EISP"."T_GENERAL_METER_TG" ENABLE;
 

  CREATE TABLE "EISP"."T_GENERAL_METER_DETAIL" 
   (	"GM_ID" NUMBER(10,0) NOT NULL ENABLE, 
	"GMD_TV_TEMPLATE" VARCHAR2(32 BYTE), 
	"GMD_PROTOCOL" VARCHAR2(32 BYTE), 
	"GMD_MEASURE_METHOD" VARCHAR2(32 BYTE), 
	"GMD_ADDR" VARCHAR2(100 BYTE), 
	"GMD_STREAM_CONTROL" VARCHAR2(20 BYTE), 
	"GMD_PARITY_BIT" VARCHAR2(20 BYTE), 
	"GMD_BAUD_RATE" NUMBER(10,0), 
	"GMD_DATA_BIT" NUMBER(10,0), 
	"GMD_STOP_BIT" NUMBER(10,0), 
	"GMD_BALANCE_DAY" NUMBER(2,0), 
	"GMD_BALANCE_HOUR" NUMBER(2,0), 
	"GMD_BALANCE_MINUTE" NUMBER(2,0), 
	"GMD_MIN_STEP" NUMBER(10,0), 
	"GMD_FEE_METHOD" VARCHAR2(32 BYTE), 
	"GMD_DURING_METHOD" VARCHAR2(32 BYTE), 
	"GMD_V_LEVEL" VARCHAR2(2 BYTE), 
	"GMD_TV_ERROR" NUMBER(10,2), 
	"GMD_FULL_YARD" NUMBER(10,0), 
	"GMD_CONNECTION" VARCHAR2(100 BYTE), 
	"CREATE_DATE" TIMESTAMP (6) NOT NULL ENABLE, 
	"CREATE_BY" VARCHAR2(20 BYTE) NOT NULL ENABLE, 
	"LAST_EDIT_DATE" TIMESTAMP (6) NOT NULL ENABLE, 
	"LAST_EDIT_BY" VARCHAR2(20 BYTE) NOT NULL ENABLE, 
	 CONSTRAINT "GMD_PK" PRIMARY KEY ("GM_ID")
  USING INDEX PCTFREE 10 INITRANS 2 MAXTRANS 255 COMPUTE STATISTICS 
  STORAGE(INITIAL 65536 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645
  PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1 BUFFER_POOL DEFAULT)
  TABLESPACE "EISP"  ENABLE, 
	 CONSTRAINT "GM_GMD_FK" FOREIGN KEY ("GM_ID")
	  REFERENCES "EISP"."T_GENERAL_METER" ("ID") ON DELETE CASCADE ENABLE
   ) PCTFREE 10 PCTUSED 40 INITRANS 1 MAXTRANS 255 NOCOMPRESS LOGGING
  STORAGE(INITIAL 65536 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645
  PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1 BUFFER_POOL DEFAULT)
  TABLESPACE "EISP" ;
 

   COMMENT ON COLUMN "EISP"."T_GENERAL_METER_DETAIL"."GMD_TV_TEMPLATE" IS '阈值模板';
 
   COMMENT ON COLUMN "EISP"."T_GENERAL_METER_DETAIL"."GMD_PROTOCOL" IS '表协议';
 
   COMMENT ON COLUMN "EISP"."T_GENERAL_METER_DETAIL"."GMD_MEASURE_METHOD" IS '计量方式';
 
   COMMENT ON COLUMN "EISP"."T_GENERAL_METER_DETAIL"."GMD_ADDR" IS '表地址';
 
   COMMENT ON COLUMN "EISP"."T_GENERAL_METER_DETAIL"."GMD_STREAM_CONTROL" IS '流控制';
 
   COMMENT ON COLUMN "EISP"."T_GENERAL_METER_DETAIL"."GMD_PARITY_BIT" IS '校验位';
 
   COMMENT ON COLUMN "EISP"."T_GENERAL_METER_DETAIL"."GMD_BAUD_RATE" IS '波特率';
 
   COMMENT ON COLUMN "EISP"."T_GENERAL_METER_DETAIL"."GMD_DATA_BIT" IS '数据位';
 
   COMMENT ON COLUMN "EISP"."T_GENERAL_METER_DETAIL"."GMD_STOP_BIT" IS '停止位';
 
   COMMENT ON COLUMN "EISP"."T_GENERAL_METER_DETAIL"."GMD_BALANCE_DAY" IS '月结算日';
 
   COMMENT ON COLUMN "EISP"."T_GENERAL_METER_DETAIL"."GMD_BALANCE_HOUR" IS '日结算小时';
 
   COMMENT ON COLUMN "EISP"."T_GENERAL_METER_DETAIL"."GMD_BALANCE_MINUTE" IS '日结算分钟';
 
   COMMENT ON COLUMN "EISP"."T_GENERAL_METER_DETAIL"."GMD_MIN_STEP" IS '最小计算步长';
 
   COMMENT ON COLUMN "EISP"."T_GENERAL_METER_DETAIL"."GMD_FEE_METHOD" IS '费率方案';
 
   COMMENT ON COLUMN "EISP"."T_GENERAL_METER_DETAIL"."GMD_DURING_METHOD" IS '时段方案';
 
   COMMENT ON COLUMN "EISP"."T_GENERAL_METER_DETAIL"."GMD_V_LEVEL" IS '电压等级';
 
   COMMENT ON COLUMN "EISP"."T_GENERAL_METER_DETAIL"."GMD_TV_ERROR" IS '分总误差阀值';
 
   COMMENT ON COLUMN "EISP"."T_GENERAL_METER_DETAIL"."GMD_FULL_YARD" IS '满码值';
 
   COMMENT ON COLUMN "EISP"."T_GENERAL_METER_DETAIL"."GMD_CONNECTION" IS '接线方式';
 
   COMMENT ON TABLE "EISP"."T_GENERAL_METER_DETAIL"  IS '总表详细信息';
 

  CREATE TABLE "EISP"."T_GROUP" 
   (	"ID" NUMBER(10,0) NOT NULL ENABLE, 
	"OT_ID" NUMBER(10,0), 
	"G_NAME" VARCHAR2(100 BYTE), 
	"G_CODE" VARCHAR2(20 BYTE), 
	"G_ADDR" VARCHAR2(100 BYTE), 
	"G_SALE_NO" VARCHAR2(20 BYTE), 
	"G_DIRECTOR" VARCHAR2(20 BYTE), 
	"G_IMMOBILE_TEL" VARCHAR2(20 BYTE), 
	"G_MOBILE" VARCHAR2(20 BYTE), 
	"G_FAX" VARCHAR2(20 BYTE), 
	"G_ISGROUP" VARCHAR2(2 BYTE), 
	"G_ENABLED" VARCHAR2(2 BYTE), 
	"G_SUPERVISOR" NUMBER(10,0), 
	"G_COPY_DAY" NUMBER(2,0), 
	"G_COPY_NO" VARCHAR2(20 BYTE), 
	"CREATE_DATE" TIMESTAMP (6) NOT NULL ENABLE, 
	"CREATE_BY" VARCHAR2(20 BYTE) NOT NULL ENABLE, 
	"LAST_EDIT_DATE" TIMESTAMP (6) NOT NULL ENABLE, 
	"LAST_EDIT_BY" VARCHAR2(20 BYTE) NOT NULL ENABLE, 
	"G_UPPER_LINE" NUMBER(5,2), 
	 CONSTRAINT "T_GROUP_PK" PRIMARY KEY ("ID")
  USING INDEX PCTFREE 10 INITRANS 2 MAXTRANS 255 COMPUTE STATISTICS 
  STORAGE(INITIAL 65536 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645
  PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1 BUFFER_POOL DEFAULT)
  TABLESPACE "EISP"  ENABLE, 
	 CONSTRAINT "G_G_FK" FOREIGN KEY ("G_SUPERVISOR")
	  REFERENCES "EISP"."T_GROUP" ("ID") ENABLE, 
	 CONSTRAINT "G_OT_FK" FOREIGN KEY ("OT_ID")
	  REFERENCES "EISP"."T_ORG_TYPE" ("ID") ENABLE
   ) PCTFREE 10 PCTUSED 40 INITRANS 1 MAXTRANS 255 NOCOMPRESS LOGGING
  STORAGE(INITIAL 65536 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645
  PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1 BUFFER_POOL DEFAULT)
  TABLESPACE "EISP" ;
 

   COMMENT ON COLUMN "EISP"."T_GROUP"."G_NAME" IS '台区或机构名';
 
   COMMENT ON COLUMN "EISP"."T_GROUP"."G_CODE" IS '机构编码';
 
   COMMENT ON COLUMN "EISP"."T_GROUP"."G_SALE_NO" IS '营销号';
 
   COMMENT ON COLUMN "EISP"."T_GROUP"."G_DIRECTOR" IS '责任人';
 
   COMMENT ON COLUMN "EISP"."T_GROUP"."G_IMMOBILE_TEL" IS '固定电话';
 
   COMMENT ON COLUMN "EISP"."T_GROUP"."G_MOBILE" IS '手机';
 
   COMMENT ON COLUMN "EISP"."T_GROUP"."G_FAX" IS '传真';
 
   COMMENT ON COLUMN "EISP"."T_GROUP"."G_ISGROUP" IS '是否是台区（0：不是 1：是）';
 
   COMMENT ON COLUMN "EISP"."T_GROUP"."G_ENABLED" IS '状态（0：不使用 1：使用）';
 
   COMMENT ON COLUMN "EISP"."T_GROUP"."G_SUPERVISOR" IS '上级目录';
 
   COMMENT ON COLUMN "EISP"."T_GROUP"."G_COPY_DAY" IS '抄表时间';
 
   COMMENT ON COLUMN "EISP"."T_GROUP"."G_COPY_NO" IS '抄表本号';
 
   COMMENT ON COLUMN "EISP"."T_GROUP"."G_UPPER_LINE" IS '线损阈值';
 

  CREATE TABLE "EISP"."T_GROUP_ADMIN" 
   (	"ROLE_DATA_ID" NUMBER(10,0) NOT NULL ENABLE, 
	"RD_RW" NUMBER(10,0), 
	"RD_CONTROL" NUMBER(10,0), 
	"CREATE_DATE" TIMESTAMP (6) NOT NULL ENABLE, 
	"CREATE_BY" VARCHAR2(20 BYTE) NOT NULL ENABLE, 
	"LAST_EDIT_DATE" TIMESTAMP (6) NOT NULL ENABLE, 
	"LAST_EDIT_BY" VARCHAR2(20 BYTE) NOT NULL ENABLE, 
	"GROUP_ID" NUMBER(10,0), 
	"ID" NUMBER(10,0) NOT NULL ENABLE, 
	 CONSTRAINT "T_GROUP_ADMIN_PK" PRIMARY KEY ("ID")
  USING INDEX PCTFREE 10 INITRANS 2 MAXTRANS 255 COMPUTE STATISTICS 
  STORAGE(INITIAL 65536 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645
  PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1 BUFFER_POOL DEFAULT)
  TABLESPACE "EISP"  ENABLE, 
	 CONSTRAINT "GA_G_FK" FOREIGN KEY ("GROUP_ID")
	  REFERENCES "EISP"."T_GROUP" ("ID") ENABLE, 
	 CONSTRAINT "RD_RA_FK" FOREIGN KEY ("ROLE_DATA_ID")
	  REFERENCES "EISP"."T_ROLE_DATA" ("ID") ENABLE
   ) PCTFREE 10 PCTUSED 40 INITRANS 1 MAXTRANS 255 NOCOMPRESS LOGGING
  STORAGE(INITIAL 65536 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645
  PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1 BUFFER_POOL DEFAULT)
  TABLESPACE "EISP" ;
 

   COMMENT ON COLUMN "EISP"."T_GROUP_ADMIN"."RD_RW" IS '数据角色读写权限（0：无权限 1：有权限）';
 
   COMMENT ON COLUMN "EISP"."T_GROUP_ADMIN"."RD_CONTROL" IS '数据角色控制权限 （0：无权限 1：有权限）';
 

  CREATE TABLE "EISP"."T_LINE_LOSS" 
   (	"GROUP_ID" NUMBER(10,0) NOT NULL ENABLE, 
	"USED_QUANTITY_ELECT" NUMBER(12,4), 
	"SUPPLY_QUANTITY_ELECT" NUMBER(12,4), 
	"LINE_LOSS_RATIO" NUMBER(5,2), 
	"IS_FORCE" VARCHAR2(2 BYTE), 
	"CALC_DATE" TIMESTAMP (6), 
	"DATA_TIME" TIMESTAMP (6), 
	"ID" NUMBER(10,0) NOT NULL ENABLE, 
	"LINE_LOST_TYPE" VARCHAR2(2 BYTE), 
	 CONSTRAINT "T_LINE_LOSE_PK" PRIMARY KEY ("ID")
  USING INDEX PCTFREE 10 INITRANS 2 MAXTRANS 255 COMPUTE STATISTICS 
  STORAGE(INITIAL 65536 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645
  PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1 BUFFER_POOL DEFAULT)
  TABLESPACE "EISP"  ENABLE, 
	 CONSTRAINT "LL_G_FK" FOREIGN KEY ("GROUP_ID")
	  REFERENCES "EISP"."T_GROUP" ("ID") ENABLE
   ) PCTFREE 10 PCTUSED 40 INITRANS 1 MAXTRANS 255 NOCOMPRESS LOGGING
  STORAGE(INITIAL 65536 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645
  PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1 BUFFER_POOL DEFAULT)
  TABLESPACE "EISP" ;
 

   COMMENT ON COLUMN "EISP"."T_LINE_LOSS"."USED_QUANTITY_ELECT" IS '用电量';
 
   COMMENT ON COLUMN "EISP"."T_LINE_LOSS"."SUPPLY_QUANTITY_ELECT" IS '供电量';
 
   COMMENT ON COLUMN "EISP"."T_LINE_LOSS"."LINE_LOSS_RATIO" IS '线损率';
 
   COMMENT ON COLUMN "EISP"."T_LINE_LOSS"."IS_FORCE" IS '是否为强制计算
0：是
1：否';
 
   COMMENT ON COLUMN "EISP"."T_LINE_LOSS"."CALC_DATE" IS '线损计算时间';
 
   COMMENT ON COLUMN "EISP"."T_LINE_LOSS"."DATA_TIME" IS '线损数据产生日期';
 
   COMMENT ON COLUMN "EISP"."T_LINE_LOSS"."LINE_LOST_TYPE" IS '线损类型
0：日线损
1：月线损';
 
   COMMENT ON TABLE "EISP"."T_LINE_LOSS"  IS '线损表';
 

  CREATE OR REPLACE TRIGGER "EISP"."T_LINE_LOSE_TG" 
  before insert on T_LINE_LOSS
  for each row
begin
   SELECT T_LINE_LOSE_SEQ.NEXTVAL INTO :NEW.id FROM DUAL;
end T_LINE_LOSE_TG;


/
ALTER TRIGGER "EISP"."T_LINE_LOSE_TG" ENABLE;
 

  CREATE TABLE "EISP"."T_LOG" 
   (	"ID" NUMBER(10,0) NOT NULL ENABLE, 
	"L_NAME" VARCHAR2(100 BYTE), 
	"L_TIME" TIMESTAMP (6), 
	"L_OPERATOR" VARCHAR2(20 BYTE), 
	"L_IP" VARCHAR2(20 BYTE), 
	"L_MESSAGE" VARCHAR2(100 BYTE), 
	"L_OPR_TYPE" VARCHAR2(20 BYTE), 
	"CREATE_DATE" TIMESTAMP (6) NOT NULL ENABLE, 
	"CREATE_BY" VARCHAR2(20 BYTE) NOT NULL ENABLE, 
	"LAST_EDIT_DATE" TIMESTAMP (6) NOT NULL ENABLE, 
	"LAST_EDIT_BY" VARCHAR2(20 BYTE) NOT NULL ENABLE, 
	 CONSTRAINT "T_LOG_PK" PRIMARY KEY ("ID")
  USING INDEX PCTFREE 10 INITRANS 2 MAXTRANS 255 COMPUTE STATISTICS 
  STORAGE(INITIAL 65536 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645
  PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1 BUFFER_POOL DEFAULT)
  TABLESPACE "EISP"  ENABLE
   ) PCTFREE 10 PCTUSED 40 INITRANS 1 MAXTRANS 255 NOCOMPRESS LOGGING
  STORAGE(INITIAL 65536 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645
  PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1 BUFFER_POOL DEFAULT)
  TABLESPACE "EISP" ;
 

   COMMENT ON COLUMN "EISP"."T_LOG"."L_OPERATOR" IS '操作人员';
 
   COMMENT ON COLUMN "EISP"."T_LOG"."L_IP" IS '操作IP地址';
 
   COMMENT ON COLUMN "EISP"."T_LOG"."L_MESSAGE" IS '信息';
 
   COMMENT ON COLUMN "EISP"."T_LOG"."L_OPR_TYPE" IS '操作类型';
 
   COMMENT ON TABLE "EISP"."T_LOG"  IS '日志表';
 

  CREATE TABLE "EISP"."T_LV_FREEZE_D_DATA" 
   (	"ID" NUMBER(10,0) NOT NULL ENABLE, 
	"LFM_FR_DATE" TIMESTAMP (6), 
	"LFD_TYPE" VARCHAR2(2 BYTE), 
	"LFD_VAL_PP" NUMBER(10,2), 
	"LFD_VAL_PQ" NUMBER(10,2), 
	"LFD_TIMES_RATE" NUMBER(10,2), 
	"MP_ID" NUMBER(10,0), 
	"LFD_VAL_NP" NUMBER(10,2), 
	"LFD_VAL_NQ" NUMBER(10,2), 
	"LFD_COST_RATE" NUMBER(10,3), 
	 CONSTRAINT "LFD_PK" PRIMARY KEY ("ID")
  USING INDEX PCTFREE 10 INITRANS 2 MAXTRANS 255 COMPUTE STATISTICS 
  STORAGE(INITIAL 65536 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645
  PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1 BUFFER_POOL DEFAULT)
  TABLESPACE "EISP"  ENABLE
   ) PCTFREE 10 PCTUSED 40 INITRANS 1 MAXTRANS 255 NOCOMPRESS LOGGING
  STORAGE(INITIAL 65536 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645
  PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1 BUFFER_POOL DEFAULT)
  TABLESPACE "EISP" ;
 

   COMMENT ON COLUMN "EISP"."T_LV_FREEZE_D_DATA"."LFM_FR_DATE" IS '冻结时间';
 
   COMMENT ON COLUMN "EISP"."T_LV_FREEZE_D_DATA"."LFD_TYPE" IS '表类型
0:总表
1:居民表计';
 
   COMMENT ON COLUMN "EISP"."T_LV_FREEZE_D_DATA"."LFD_VAL_PP" IS '正向有功功率';
 
   COMMENT ON COLUMN "EISP"."T_LV_FREEZE_D_DATA"."LFD_VAL_PQ" IS '正向无功功率';
 
   COMMENT ON COLUMN "EISP"."T_LV_FREEZE_D_DATA"."LFD_TIMES_RATE" IS '倍率';
 
   COMMENT ON COLUMN "EISP"."T_LV_FREEZE_D_DATA"."LFD_VAL_NP" IS '反向有功功率';
 
   COMMENT ON COLUMN "EISP"."T_LV_FREEZE_D_DATA"."LFD_VAL_NQ" IS '反向无功功率';
 
   COMMENT ON TABLE "EISP"."T_LV_FREEZE_D_DATA"  IS '低压_日冻结表码数据表';
 

  CREATE OR REPLACE TRIGGER "EISP"."T_LV_FREEZE_D_DATA_TG" 
  before insert on T_LV_FREEZE_D_DATA
  for each row
begin
   SELECT T_LV_FREEZE_D_DATA_SEQ.NEXTVAL INTO :NEW.id FROM DUAL;
end T_LV_FREEZE_D_DATA_TG;


/
ALTER TRIGGER "EISP"."T_LV_FREEZE_D_DATA_TG" ENABLE;
 

  CREATE TABLE "EISP"."T_LV_FREEZE_EM" 
   (	"LFE_FR_DATE" TIMESTAMP (6), 
	"ID" NUMBER(10,0) NOT NULL ENABLE, 
	"LFE_VAL_PP" NUMBER(10,2), 
	"LFE_VAL_PQ" NUMBER(10,2), 
	"LFE_TIMES_RATE" NUMBER(10,2), 
	"MP_ID" NUMBER(10,0), 
	"LFE_VAL_NP" NUMBER(10,2), 
	"LFE_VAL_NQ" NUMBER(10,2), 
	"LFE_COST_RATE" NUMBER(10,3), 
	 CONSTRAINT "LFE_PK" PRIMARY KEY ("ID")
  USING INDEX PCTFREE 10 INITRANS 2 MAXTRANS 255 COMPUTE STATISTICS 
  STORAGE(INITIAL 65536 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645
  PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1 BUFFER_POOL DEFAULT)
  TABLESPACE "EISP"  ENABLE
   ) PCTFREE 10 PCTUSED 40 INITRANS 1 MAXTRANS 255 NOCOMPRESS LOGGING
  STORAGE(INITIAL 65536 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645
  PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1 BUFFER_POOL DEFAULT)
  TABLESPACE "EISP" ;
 

   COMMENT ON COLUMN "EISP"."T_LV_FREEZE_EM"."LFE_FR_DATE" IS '采集时间';
 
   COMMENT ON COLUMN "EISP"."T_LV_FREEZE_EM"."LFE_VAL_PP" IS '正向有功功率';
 
   COMMENT ON COLUMN "EISP"."T_LV_FREEZE_EM"."LFE_VAL_PQ" IS '正向无功功率';
 
   COMMENT ON COLUMN "EISP"."T_LV_FREEZE_EM"."LFE_TIMES_RATE" IS '倍率';
 
   COMMENT ON COLUMN "EISP"."T_LV_FREEZE_EM"."MP_ID" IS '测量点号';
 
   COMMENT ON COLUMN "EISP"."T_LV_FREEZE_EM"."LFE_VAL_NP" IS '反向有功功率';
 
   COMMENT ON COLUMN "EISP"."T_LV_FREEZE_EM"."LFE_VAL_NQ" IS '反向无功功率';
 
   COMMENT ON TABLE "EISP"."T_LV_FREEZE_EM"  IS '低压_重点用户表码数据表';
 

  CREATE OR REPLACE TRIGGER "EISP"."T_LV_FREEZE_EM_TG" 
  before insert on T_LV_FREEZE_EM
  for each row
begin
   SELECT T_LV_FREEZE_EM_SEQ.NEXTVAL INTO :NEW.id FROM DUAL;
end T_LV_FREEZE_EM_TG;


/
ALTER TRIGGER "EISP"."T_LV_FREEZE_EM_TG" ENABLE;
 

  CREATE TABLE "EISP"."T_LV_FREEZE_GEN" 
   (	"ID" NUMBER(10,0) NOT NULL ENABLE, 
	"MP_ID" NUMBER(10,0), 
	"LFG_FR_DATE" TIMESTAMP (6), 
	"LFG_DATA_TYPE" VARCHAR2(2 BYTE), 
	"LFG_PA" NUMBER(10,3), 
	"LFG_PB" NUMBER(10,3), 
	"LFG_PC" NUMBER(10,3), 
	 CONSTRAINT "T_LV_FREEZE_GEN_PK" PRIMARY KEY ("ID")
  USING INDEX PCTFREE 10 INITRANS 2 MAXTRANS 255 COMPUTE STATISTICS 
  STORAGE(INITIAL 65536 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645
  PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1 BUFFER_POOL DEFAULT)
  TABLESPACE "EISP"  ENABLE
   ) PCTFREE 10 PCTUSED 40 INITRANS 1 MAXTRANS 255 NOCOMPRESS LOGGING
  STORAGE(INITIAL 65536 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645
  PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1 BUFFER_POOL DEFAULT)
  TABLESPACE "EISP" ;
 

   COMMENT ON COLUMN "EISP"."T_LV_FREEZE_GEN"."MP_ID" IS '测量点编号';
 
   COMMENT ON COLUMN "EISP"."T_LV_FREEZE_GEN"."LFG_FR_DATE" IS '数据冻结时间';
 
   COMMENT ON COLUMN "EISP"."T_LV_FREEZE_GEN"."LFG_DATA_TYPE" IS '1. 有功功率（二次）
2. 无功功率（二次）3. 电压（二次）
4. 电流（二次）
5. 功率因数（二次）
6 有功功率（一次）
7. 无功功率（一次）
8. 电压（一次）
9. 电流（一次）
10. 功率因数（一次）';
 
   COMMENT ON COLUMN "EISP"."T_LV_FREEZE_GEN"."LFG_PA" IS '数据_A 相';
 
   COMMENT ON COLUMN "EISP"."T_LV_FREEZE_GEN"."LFG_PB" IS '数据_B 相';
 
   COMMENT ON COLUMN "EISP"."T_LV_FREEZE_GEN"."LFG_PC" IS '数据_C 相';
 
   COMMENT ON TABLE "EISP"."T_LV_FREEZE_GEN"  IS '总表瞬时量数据表';
 

  CREATE TABLE "EISP"."T_LV_FREEZE_GEN_EXTREMUM" 
   (	"ID" NUMBER(10,0) NOT NULL ENABLE, 
	"MP_ID" NUMBER(10,0), 
	"RMMP_FR_DATE" TIMESTAMP (6), 
	"RMMP_DA" NUMBER(2,0), 
	"RMMP_LA" NUMBER(10,3), 
	"RMMP_LB" NUMBER(10,3), 
	"RMMP_LC" NUMBER(10,3), 
	"RMMP_LN" NUMBER(10,3), 
	"RMMP_SA" NUMBER(10,3), 
	"RMMP_SB" NUMBER(10,3), 
	"RMMP_SC" NUMBER(10,3), 
	"RMMP_SN" NUMBER(10,3), 
	"RMMP_LADT" TIMESTAMP (6), 
	"RMMP_LBDT" TIMESTAMP (6), 
	"RMMP_LCDT" TIMESTAMP (6), 
	"RMMP_LNDT" TIMESTAMP (6), 
	"RMMP_SADT" TIMESTAMP (6), 
	"RMMP_SBDT" TIMESTAMP (6), 
	"RMMP_SCDT" TIMESTAMP (6), 
	"RMMP_SNDT" TIMESTAMP (6), 
	 CONSTRAINT "LFGE_PK" PRIMARY KEY ("ID")
  USING INDEX PCTFREE 10 INITRANS 2 MAXTRANS 255 COMPUTE STATISTICS 
  STORAGE(INITIAL 65536 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645
  PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1 BUFFER_POOL DEFAULT)
  TABLESPACE "EISP"  ENABLE
   ) PCTFREE 10 PCTUSED 40 INITRANS 1 MAXTRANS 255 NOCOMPRESS LOGGING
  STORAGE(INITIAL 65536 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645
  PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1 BUFFER_POOL DEFAULT)
  TABLESPACE "EISP" ;
 

   COMMENT ON COLUMN "EISP"."T_LV_FREEZE_GEN_EXTREMUM"."MP_ID" IS '测量点编号';
 
   COMMENT ON COLUMN "EISP"."T_LV_FREEZE_GEN_EXTREMUM"."RMMP_FR_DATE" IS '冻结时间。';
 
   COMMENT ON COLUMN "EISP"."T_LV_FREEZE_GEN_EXTREMUM"."RMMP_DA" IS '1：有功功率
2：无功功率
3：电压
4：电流
5：功率因数';
 
   COMMENT ON COLUMN "EISP"."T_LV_FREEZE_GEN_EXTREMUM"."RMMP_LA" IS 'A 相最大值';
 
   COMMENT ON COLUMN "EISP"."T_LV_FREEZE_GEN_EXTREMUM"."RMMP_LB" IS 'B 相最大值';
 
   COMMENT ON COLUMN "EISP"."T_LV_FREEZE_GEN_EXTREMUM"."RMMP_LC" IS 'C 相最大值';
 
   COMMENT ON COLUMN "EISP"."T_LV_FREEZE_GEN_EXTREMUM"."RMMP_LN" IS '中性线 最大值';
 
   COMMENT ON COLUMN "EISP"."T_LV_FREEZE_GEN_EXTREMUM"."RMMP_SA" IS 'A 相最小值';
 
   COMMENT ON COLUMN "EISP"."T_LV_FREEZE_GEN_EXTREMUM"."RMMP_SB" IS 'B 相最小值';
 
   COMMENT ON COLUMN "EISP"."T_LV_FREEZE_GEN_EXTREMUM"."RMMP_SC" IS 'C 相最小值';
 
   COMMENT ON COLUMN "EISP"."T_LV_FREEZE_GEN_EXTREMUM"."RMMP_SN" IS '中性线 最小值';
 
   COMMENT ON COLUMN "EISP"."T_LV_FREEZE_GEN_EXTREMUM"."RMMP_LADT" IS 'A 相最大值出现时间';
 
   COMMENT ON COLUMN "EISP"."T_LV_FREEZE_GEN_EXTREMUM"."RMMP_LBDT" IS 'B 相最大值出现时间';
 
   COMMENT ON COLUMN "EISP"."T_LV_FREEZE_GEN_EXTREMUM"."RMMP_LCDT" IS 'C 相最大值出现时间';
 
   COMMENT ON COLUMN "EISP"."T_LV_FREEZE_GEN_EXTREMUM"."RMMP_LNDT" IS '中性线 最大值出现时间';
 
   COMMENT ON COLUMN "EISP"."T_LV_FREEZE_GEN_EXTREMUM"."RMMP_SADT" IS 'A 相最小值出现时间';
 
   COMMENT ON COLUMN "EISP"."T_LV_FREEZE_GEN_EXTREMUM"."RMMP_SBDT" IS 'B 相最小值出现时间';
 
   COMMENT ON COLUMN "EISP"."T_LV_FREEZE_GEN_EXTREMUM"."RMMP_SCDT" IS 'C 相最小值出现时间';
 
   COMMENT ON COLUMN "EISP"."T_LV_FREEZE_GEN_EXTREMUM"."RMMP_SNDT" IS '中性线 相最小值出现时间';
 
   COMMENT ON TABLE "EISP"."T_LV_FREEZE_GEN_EXTREMUM"  IS '电力数据极值表结构';
 

  CREATE TABLE "EISP"."T_LV_FREEZE_MY_DATA" 
   (	"ID" NUMBER(10,0) NOT NULL ENABLE, 
	"LFM_FR_DATE" TIMESTAMP (6), 
	"LFM_FR_TYPE" VARCHAR2(2 BYTE), 
	"LFM_TYPE" VARCHAR2(2 BYTE), 
	"LFM_VAL_PP" NUMBER(10,2), 
	"LFM_VAL_PQ" NUMBER(10,2), 
	"LFM_TIMES_RATE" NUMBER(10,2), 
	"MP_ID" NUMBER(10,0), 
	"LEM_VAL_NP" NUMBER(10,2), 
	"LEM_VAL_NQ" NUMBER(10,2), 
	"LEM_COST_RATE" NUMBER(10,3), 
	 CONSTRAINT "LFM_PK" PRIMARY KEY ("ID")
  USING INDEX PCTFREE 10 INITRANS 2 MAXTRANS 255 COMPUTE STATISTICS 
  STORAGE(INITIAL 65536 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645
  PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1 BUFFER_POOL DEFAULT)
  TABLESPACE "EISP"  ENABLE
   ) PCTFREE 10 PCTUSED 40 INITRANS 1 MAXTRANS 255 NOCOMPRESS LOGGING
  STORAGE(INITIAL 65536 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645
  PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1 BUFFER_POOL DEFAULT)
  TABLESPACE "EISP" ;
 

   COMMENT ON COLUMN "EISP"."T_LV_FREEZE_MY_DATA"."LFM_FR_DATE" IS '冻结时间';
 
   COMMENT ON COLUMN "EISP"."T_LV_FREEZE_MY_DATA"."LFM_FR_TYPE" IS '冻结类型（0：月 1：年）';
 
   COMMENT ON COLUMN "EISP"."T_LV_FREEZE_MY_DATA"."LFM_TYPE" IS '表类型';
 
   COMMENT ON COLUMN "EISP"."T_LV_FREEZE_MY_DATA"."LFM_VAL_PP" IS '正向有功功率';
 
   COMMENT ON COLUMN "EISP"."T_LV_FREEZE_MY_DATA"."LFM_VAL_PQ" IS '正向无功功率';
 
   COMMENT ON COLUMN "EISP"."T_LV_FREEZE_MY_DATA"."LFM_TIMES_RATE" IS '倍率';
 
   COMMENT ON COLUMN "EISP"."T_LV_FREEZE_MY_DATA"."MP_ID" IS '测量点号';
 
   COMMENT ON COLUMN "EISP"."T_LV_FREEZE_MY_DATA"."LEM_VAL_NP" IS '反向有功功率';
 
   COMMENT ON COLUMN "EISP"."T_LV_FREEZE_MY_DATA"."LEM_VAL_NQ" IS '反向无功功率';
 
   COMMENT ON COLUMN "EISP"."T_LV_FREEZE_MY_DATA"."LEM_COST_RATE" IS '费率';
 
   COMMENT ON TABLE "EISP"."T_LV_FREEZE_MY_DATA"  IS '(低压_年月冻结表码数据表';
 

  CREATE OR REPLACE TRIGGER "EISP"."T_LV_FREEZE_MY_DATA_TG" 
  before insert on T_LV_FREEZE_MY_DATA
  for each row
begin
   SELECT T_LV_FREEZE_MY_DATA_SEQ.NEXTVAL INTO :NEW.id FROM DUAL;
end T_LV_FREEZE_MY_DATA_TG;


/
ALTER TRIGGER "EISP"."T_LV_FREEZE_MY_DATA_TG" ENABLE;
 

  CREATE TABLE "EISP"."T_LV_FREEZE_PLOAD" 
   (	"ID" NUMBER(10,0) NOT NULL ENABLE, 
	"MP_ID" NUMBER(10,0), 
	"FLP_FR_DATE" TIMESTAMP (6), 
	"FLP_VAL_PP" NUMBER(10,3), 
	"FLP_VAL_PQ" NUMBER(10,3), 
	"FLP_VAL_NP" NUMBER(10,3), 
	"FLP_VAL_NQ" NUMBER(10,3), 
	 CONSTRAINT "LFP_PK" PRIMARY KEY ("ID")
  USING INDEX PCTFREE 10 INITRANS 2 MAXTRANS 255 COMPUTE STATISTICS 
  STORAGE(INITIAL 65536 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645
  PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1 BUFFER_POOL DEFAULT)
  TABLESPACE "EISP"  ENABLE
   ) PCTFREE 10 PCTUSED 40 INITRANS 1 MAXTRANS 255 NOCOMPRESS LOGGING
  STORAGE(INITIAL 65536 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645
  PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1 BUFFER_POOL DEFAULT)
  TABLESPACE "EISP" ;
 

   COMMENT ON COLUMN "EISP"."T_LV_FREEZE_PLOAD"."FLP_VAL_PP" IS '正向有功';
 
   COMMENT ON COLUMN "EISP"."T_LV_FREEZE_PLOAD"."FLP_VAL_PQ" IS '正向无功';
 
   COMMENT ON COLUMN "EISP"."T_LV_FREEZE_PLOAD"."FLP_VAL_NP" IS '反向有功';
 
   COMMENT ON COLUMN "EISP"."T_LV_FREEZE_PLOAD"."FLP_VAL_NQ" IS '反向无功';
 
   COMMENT ON TABLE "EISP"."T_LV_FREEZE_PLOAD"  IS '负荷曲线记录表';
 

  CREATE TABLE "EISP"."T_M_ELEC_QUANTITY" 
   (	"ID" NUMBER(10,0) NOT NULL ENABLE, 
	"MP_ID" NUMBER(10,0), 
	"M_TYPE" VARCHAR2(2 BYTE), 
	"MEQ_DATE" TIMESTAMP (6), 
	"MEQ_PP" NUMBER(10,2), 
	"MEQ_QQ" NUMBER(10,2), 
	"MEQ_VAL_PP1" NUMBER(10,2), 
	"MEQ_VAL_QQ1" NUMBER(10,2), 
	"MEQ_VAL_PP2" NUMBER(10,2), 
	"MEQ_VAL_QQ2" NUMBER(10,2)
   ) PCTFREE 10 PCTUSED 40 INITRANS 1 MAXTRANS 255 NOCOMPRESS LOGGING
  STORAGE(INITIAL 65536 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645
  PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1 BUFFER_POOL DEFAULT)
  TABLESPACE "EISP" ;
 

   COMMENT ON COLUMN "EISP"."T_M_ELEC_QUANTITY"."MP_ID" IS '计量点号';
 
   COMMENT ON COLUMN "EISP"."T_M_ELEC_QUANTITY"."M_TYPE" IS '(电表类型 0：总表 1：居民表)';
 
   COMMENT ON COLUMN "EISP"."T_M_ELEC_QUANTITY"."MEQ_DATE" IS '日期';
 
   COMMENT ON COLUMN "EISP"."T_M_ELEC_QUANTITY"."MEQ_PP" IS '有功电量';
 
   COMMENT ON COLUMN "EISP"."T_M_ELEC_QUANTITY"."MEQ_QQ" IS '无功电量';
 
   COMMENT ON COLUMN "EISP"."T_M_ELEC_QUANTITY"."MEQ_VAL_PP1" IS '前一日有用功率';
 
   COMMENT ON COLUMN "EISP"."T_M_ELEC_QUANTITY"."MEQ_VAL_QQ1" IS '前一日无用功率';
 
   COMMENT ON COLUMN "EISP"."T_M_ELEC_QUANTITY"."MEQ_VAL_PP2" IS '今日有用功率';
 
   COMMENT ON COLUMN "EISP"."T_M_ELEC_QUANTITY"."MEQ_VAL_QQ2" IS '近日无用功率';
 
   COMMENT ON TABLE "EISP"."T_M_ELEC_QUANTITY"  IS '月电量表';
 

  CREATE TABLE "EISP"."T_MAX_NEED" 
   (	"ID" NUMBER(10,0) NOT NULL ENABLE, 
	"MP_ID" NUMBER(10,0), 
	"MN_COST_RATE" NUMBER(10,3), 
	"MN_DATA_TYPE" NUMBER(2,0), 
	"MIN_RUN_DATE" TIMESTAMP (6), 
	"MIN_P_NEED" NUMBER(10,3), 
	"MIN_P_NEED_DATE" TIMESTAMP (6), 
	"MIN_N_NEED" NUMBER(10,3), 
	"MIN_N_NEED_DATE" TIMESTAMP (6), 
	 CONSTRAINT "MN_PK" PRIMARY KEY ("ID")
  USING INDEX PCTFREE 10 INITRANS 2 MAXTRANS 255 COMPUTE STATISTICS 
  STORAGE(INITIAL 65536 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645
  PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1 BUFFER_POOL DEFAULT)
  TABLESPACE "EISP"  ENABLE
   ) PCTFREE 10 PCTUSED 40 INITRANS 1 MAXTRANS 255 NOCOMPRESS LOGGING
  STORAGE(INITIAL 65536 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645
  PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1 BUFFER_POOL DEFAULT)
  TABLESPACE "EISP" ;
 

   COMMENT ON COLUMN "EISP"."T_MAX_NEED"."MP_ID" IS '测量点号';
 
   COMMENT ON COLUMN "EISP"."T_MAX_NEED"."MN_COST_RATE" IS '费率';
 
   COMMENT ON COLUMN "EISP"."T_MAX_NEED"."MN_DATA_TYPE" IS '数据类型
1：有功功率
2：无功功率
3：电压
4：电流
5：功率因数';
 
   COMMENT ON COLUMN "EISP"."T_MAX_NEED"."MIN_RUN_DATE" IS '最大需量抄表日期';
 
   COMMENT ON COLUMN "EISP"."T_MAX_NEED"."MIN_P_NEED" IS '正向最大需量';
 
   COMMENT ON COLUMN "EISP"."T_MAX_NEED"."MIN_P_NEED_DATE" IS '正向最大需量出现时间';
 
   COMMENT ON COLUMN "EISP"."T_MAX_NEED"."MIN_N_NEED" IS '反向最大需量';
 
   COMMENT ON COLUMN "EISP"."T_MAX_NEED"."MIN_N_NEED_DATE" IS '反向最大需量出现时间';
 
   COMMENT ON TABLE "EISP"."T_MAX_NEED"  IS '最大需量表结构';
 

  CREATE TABLE "EISP"."T_MENU" 
   (	"ID" NUMBER(10,0) NOT NULL ENABLE, 
	"M_SEQUENCE" VARCHAR2(20 BYTE), 
	"M_NAME" VARCHAR2(50 BYTE), 
	"M_REMARK" VARCHAR2(100 BYTE), 
	"M_SUPERVISOR" NUMBER(10,0), 
	"M_TYPE" VARCHAR2(2 BYTE), 
	"CREATE_DATE" TIMESTAMP (6) NOT NULL ENABLE, 
	"CREATE_BY" VARCHAR2(20 BYTE) NOT NULL ENABLE, 
	"LAST_EDIT_DATE" TIMESTAMP (6) NOT NULL ENABLE, 
	"LAST_EDIT_BY" VARCHAR2(20 BYTE) NOT NULL ENABLE, 
	 CONSTRAINT "T_MENU_PK" PRIMARY KEY ("ID")
  USING INDEX PCTFREE 10 INITRANS 2 MAXTRANS 255 COMPUTE STATISTICS 
  STORAGE(INITIAL 65536 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645
  PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1 BUFFER_POOL DEFAULT)
  TABLESPACE "EISP"  ENABLE
   ) PCTFREE 10 PCTUSED 40 INITRANS 1 MAXTRANS 255 NOCOMPRESS LOGGING
  STORAGE(INITIAL 65536 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645
  PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1 BUFFER_POOL DEFAULT)
  TABLESPACE "EISP" ;
 

   COMMENT ON COLUMN "EISP"."T_MENU"."M_SEQUENCE" IS '编码';
 
   COMMENT ON COLUMN "EISP"."T_MENU"."M_SUPERVISOR" IS '上级菜单ID';
 
   COMMENT ON COLUMN "EISP"."T_MENU"."M_TYPE" IS '菜单类型';
 
   COMMENT ON TABLE "EISP"."T_MENU"  IS '编码';
 

  CREATE TABLE "EISP"."T_MY_ELEC_QUANTITY" 
   (	"ID" NUMBER(10,0) NOT NULL ENABLE, 
	"MP_ID" NUMBER(10,0), 
	"M_TYPE" VARCHAR2(2 BYTE), 
	"MEQ_DATE" TIMESTAMP (6), 
	"MEQ_PP" NUMBER(10,2), 
	"MEQ_QQ" NUMBER(10,2), 
	"MEQ_VAL_PP1" NUMBER(10,2), 
	"MEQ_VAL_QQ1" NUMBER(10,2), 
	"MEQ_VAL_PP2" NUMBER(10,2), 
	"MEQ_VAL_QQ2" NUMBER(10,2), 
	 CONSTRAINT "MEQ_PK" PRIMARY KEY ("ID")
  USING INDEX PCTFREE 10 INITRANS 2 MAXTRANS 255 COMPUTE STATISTICS 
  STORAGE(INITIAL 65536 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645
  PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1 BUFFER_POOL DEFAULT)
  TABLESPACE "EISP"  ENABLE
   ) PCTFREE 10 PCTUSED 40 INITRANS 1 MAXTRANS 255 NOCOMPRESS LOGGING
  STORAGE(INITIAL 65536 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645
  PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1 BUFFER_POOL DEFAULT)
  TABLESPACE "EISP" ;
 

   COMMENT ON COLUMN "EISP"."T_MY_ELEC_QUANTITY"."MP_ID" IS '计量点号';
 
   COMMENT ON COLUMN "EISP"."T_MY_ELEC_QUANTITY"."M_TYPE" IS '(电表类型 0：总表 1：居民表)';
 
   COMMENT ON COLUMN "EISP"."T_MY_ELEC_QUANTITY"."MEQ_DATE" IS '日期';
 
   COMMENT ON COLUMN "EISP"."T_MY_ELEC_QUANTITY"."MEQ_PP" IS '有功电量';
 
   COMMENT ON COLUMN "EISP"."T_MY_ELEC_QUANTITY"."MEQ_QQ" IS '无功电量';
 
   COMMENT ON COLUMN "EISP"."T_MY_ELEC_QUANTITY"."MEQ_VAL_PP1" IS '前一日有用功率';
 
   COMMENT ON COLUMN "EISP"."T_MY_ELEC_QUANTITY"."MEQ_VAL_QQ1" IS '前一日无用功率';
 
   COMMENT ON COLUMN "EISP"."T_MY_ELEC_QUANTITY"."MEQ_VAL_PP2" IS '今日有用功率';
 
   COMMENT ON COLUMN "EISP"."T_MY_ELEC_QUANTITY"."MEQ_VAL_QQ2" IS '近日无用功率';
 
   COMMENT ON TABLE "EISP"."T_MY_ELEC_QUANTITY"  IS '月电量表';
 

  CREATE OR REPLACE TRIGGER "EISP"."T_MY_ELEC_QUANTITY_TG" 
  before insert on T_MY_ELEC_QUANTITY
  for each row
begin
   SELECT T_MY_ELEC_QUANTITY_SEQ.NEXTVAL INTO :NEW.id FROM DUAL;
end T_MY_ELEC_QUANTITY_TG;


/
ALTER TRIGGER "EISP"."T_MY_ELEC_QUANTITY_TG" ENABLE;
 

  CREATE TABLE "EISP"."T_ORG_TYPE" 
   (	"ID" NUMBER(10,0) NOT NULL ENABLE, 
	"OT_NAME" VARCHAR2(100 BYTE), 
	"OT_REMARK" VARCHAR2(100 BYTE), 
	"CREATE_DATE" TIMESTAMP (6) NOT NULL ENABLE, 
	"CREATE_BY" VARCHAR2(20 BYTE) NOT NULL ENABLE, 
	"LAST_EDIT_DATE" TIMESTAMP (6) NOT NULL ENABLE, 
	"LAST_EDIT_BY" VARCHAR2(20 BYTE) NOT NULL ENABLE, 
	 CONSTRAINT "T_ORG_TYPE_PK" PRIMARY KEY ("ID")
  USING INDEX PCTFREE 10 INITRANS 2 MAXTRANS 255 COMPUTE STATISTICS 
  STORAGE(INITIAL 65536 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645
  PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1 BUFFER_POOL DEFAULT)
  TABLESPACE "EISP"  ENABLE
   ) PCTFREE 10 PCTUSED 40 INITRANS 1 MAXTRANS 255 NOCOMPRESS LOGGING
  STORAGE(INITIAL 65536 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645
  PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1 BUFFER_POOL DEFAULT)
  TABLESPACE "EISP" ;
 

   COMMENT ON COLUMN "EISP"."T_ORG_TYPE"."OT_NAME" IS '机构类型名称';
 

  CREATE TABLE "EISP"."T_PUBLIC_TRANSFORMER" 
   (	"ID" NUMBER(10,0) NOT NULL ENABLE, 
	"GROUP_ID" NUMBER(10,0), 
	"PT_NAME" VARCHAR2(50 BYTE), 
	"PT_ASSET_NO" VARCHAR2(20 BYTE), 
	"PT_V_LEVEL" VARCHAR2(2 BYTE), 
	"PT_CAPACITANCE" NUMBER(10,2), 
	"PT_LINE_TYPE" VARCHAR2(2 BYTE), 
	"PT_TYPE" VARCHAR2(2 BYTE), 
	"PT_ENABLED" VARCHAR2(2 BYTE), 
	"PT_V_THRESHOLD_VALUE" NUMBER(10,2), 
	"PT_ADDR" VARCHAR2(100 BYTE), 
	"PT_POLE_NO" VARCHAR2(20 BYTE), 
	"PT_UVW_THRESHOLD_VALUE" NUMBER(10,2), 
	"PT_LOAD_THRESHOLD_VALUE" NUMBER(10,2), 
	"CREATE_DATE" TIMESTAMP (6) NOT NULL ENABLE, 
	"CREATE_BY" VARCHAR2(20 BYTE) NOT NULL ENABLE, 
	"LAST_EDIT_DATE" TIMESTAMP (6) NOT NULL ENABLE, 
	"LAST_EDIT_BY" VARCHAR2(20 BYTE) NOT NULL ENABLE, 
	"FEEDER_ID" NUMBER(10,0), 
	 CONSTRAINT "PT_PK" PRIMARY KEY ("ID")
  USING INDEX PCTFREE 10 INITRANS 2 MAXTRANS 255 COMPUTE STATISTICS 
  STORAGE(INITIAL 65536 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645
  PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1 BUFFER_POOL DEFAULT)
  TABLESPACE "EISP"  ENABLE, 
	 CONSTRAINT "PT_FEEDER_FK" FOREIGN KEY ("FEEDER_ID")
	  REFERENCES "EISP"."T_FEEDER" ("ID") ENABLE, 
	 CONSTRAINT "PT_G_FK" FOREIGN KEY ("GROUP_ID")
	  REFERENCES "EISP"."T_GROUP" ("ID") ENABLE
   ) PCTFREE 10 PCTUSED 40 INITRANS 1 MAXTRANS 255 NOCOMPRESS LOGGING
  STORAGE(INITIAL 65536 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645
  PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1 BUFFER_POOL DEFAULT)
  TABLESPACE "EISP" ;
 

   COMMENT ON COLUMN "EISP"."T_PUBLIC_TRANSFORMER"."PT_V_LEVEL" IS '电压等级';
 
   COMMENT ON COLUMN "EISP"."T_PUBLIC_TRANSFORMER"."PT_CAPACITANCE" IS '变压器容量';
 
   COMMENT ON COLUMN "EISP"."T_PUBLIC_TRANSFORMER"."PT_LINE_TYPE" IS '所属馈线(属性文件)';
 
   COMMENT ON COLUMN "EISP"."T_PUBLIC_TRANSFORMER"."PT_TYPE" IS '型号 (属性文件)';
 
   COMMENT ON COLUMN "EISP"."T_PUBLIC_TRANSFORMER"."PT_V_THRESHOLD_VALUE" IS '电压合格率阈值';
 
   COMMENT ON COLUMN "EISP"."T_PUBLIC_TRANSFORMER"."PT_ADDR" IS '安装地址';
 
   COMMENT ON COLUMN "EISP"."T_PUBLIC_TRANSFORMER"."PT_POLE_NO" IS '杆号';
 
   COMMENT ON COLUMN "EISP"."T_PUBLIC_TRANSFORMER"."PT_UVW_THRESHOLD_VALUE" IS '三相不平衡阈值';
 
   COMMENT ON COLUMN "EISP"."T_PUBLIC_TRANSFORMER"."PT_LOAD_THRESHOLD_VALUE" IS '负载率阈值';
 
   COMMENT ON TABLE "EISP"."T_PUBLIC_TRANSFORMER"  IS '公变';
 

  CREATE TABLE "EISP"."T_RESIDENT" 
   (	"ID" NUMBER(10,0) NOT NULL ENABLE, 
	"R_ID" VARCHAR2(20 BYTE), 
	"R_NAME" VARCHAR2(20 BYTE), 
	"R_NO" VARCHAR2(20 BYTE), 
	"R_POSTALCODE" VARCHAR2(20 BYTE), 
	"R_ADDR" VARCHAR2(100 BYTE), 
	"R_TEL" VARCHAR2(20 BYTE), 
	"R_MOBILE" VARCHAR2(20 BYTE), 
	"R_FAX" VARCHAR2(20 BYTE), 
	"R_CONTACT" VARCHAR2(20 BYTE), 
	"R_BALANCE_DAY" NUMBER(2,0), 
	"R_BANK_ACCOUNT" VARCHAR2(20 BYTE), 
	"CREATE_DATE" TIMESTAMP (6) NOT NULL ENABLE, 
	"CREATE_BY" VARCHAR2(20 BYTE) NOT NULL ENABLE, 
	"LAST_EDIT_DATE" TIMESTAMP (6) NOT NULL ENABLE, 
	"LAST_EDIT_BY" VARCHAR2(20 BYTE) NOT NULL ENABLE, 
	 CONSTRAINT "T_RESIDENT_PK" PRIMARY KEY ("ID")
  USING INDEX PCTFREE 10 INITRANS 2 MAXTRANS 255 COMPUTE STATISTICS 
  STORAGE(INITIAL 65536 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645
  PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1 BUFFER_POOL DEFAULT)
  TABLESPACE "EISP"  ENABLE
   ) PCTFREE 10 PCTUSED 40 INITRANS 1 MAXTRANS 255 NOCOMPRESS LOGGING
  STORAGE(INITIAL 65536 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645
  PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1 BUFFER_POOL DEFAULT)
  TABLESPACE "EISP" ;
 

   COMMENT ON COLUMN "EISP"."T_RESIDENT"."R_ID" IS '居民编号';
 
   COMMENT ON COLUMN "EISP"."T_RESIDENT"."R_NAME" IS '客户名';
 
   COMMENT ON COLUMN "EISP"."T_RESIDENT"."R_NO" IS '户号';
 
   COMMENT ON COLUMN "EISP"."T_RESIDENT"."R_POSTALCODE" IS '邮政编码';
 
   COMMENT ON COLUMN "EISP"."T_RESIDENT"."R_CONTACT" IS '联系人';
 
   COMMENT ON COLUMN "EISP"."T_RESIDENT"."R_BALANCE_DAY" IS '结算时间';
 
   COMMENT ON COLUMN "EISP"."T_RESIDENT"."R_BANK_ACCOUNT" IS '银行账户';
 
   COMMENT ON TABLE "EISP"."T_RESIDENT"  IS '居民信息表';
 

  CREATE TABLE "EISP"."T_RESIDENT_METER" 
   (	"ID" NUMBER(10,0) NOT NULL ENABLE, 
	"RESIDENT_ID" NUMBER(10,0), 
	"GROUP_ID" NUMBER(10,0), 
	"CON_ID" NUMBER(10,0), 
	"RM_ID" VARCHAR2(20 BYTE), 
	"RM_NAME" VARCHAR2(100 BYTE), 
	"RM_NO" NUMBER(10,0), 
	"RM_TYPE" NUMBER(2,0), 
	"RM_ASSET_NO" VARCHAR2(20 BYTE), 
	"RM_LOGIC_ADDR" VARCHAR2(20 BYTE), 
	"RM_IS_EMPHASES" NUMBER(2,0), 
	"RM_PRECISION" NUMBER(10,2), 
	"RM_MEASURE" NUMBER(10,2), 
	"RM_CONSTANT" NUMBER(10,2), 
	"RM_MAKE" VARCHAR2(2 BYTE), 
	"RM_MAKE_NO" VARCHAR2(20 BYTE), 
	"RM_MAKE_DATE" TIMESTAMP (6), 
	"RM_PASSWORD_H" VARCHAR2(20 BYTE), 
	"RM_PASSWORD_M" VARCHAR2(20 BYTE), 
	"RM_PASSWORD_L" VARCHAR2(20 BYTE), 
	"RM_TYPE_NO" VARCHAR2(20 BYTE), 
	"RM_STANDARD" VARCHAR2(20 BYTE), 
	"RM_CONSUMER_TYPE" VARCHAR2(2 BYTE), 
	"RM_CONNECT_METHOD" NUMBER(2,0), 
	"RM_CUT_STATUS" NUMBER(2,0), 
	"RM_BAUD_RATE" NUMBER(10,2), 
	"RM_UVW_TYPE" NUMBER(2,0), 
	"RM_COMM_METHOD" NUMBER(2,0), 
	"RM_AMP" NUMBER(10,2), 
	"RM_OFF" NUMBER(2,0), 
	"RM_INSTALL_DATE" TIMESTAMP (6), 
	"RM_ENABLED_DATE" TIMESTAMP (6), 
	"RM_DISABLED_DATE" TIMESTAMP (6), 
	"CREATE_DATE" TIMESTAMP (6) NOT NULL ENABLE, 
	"CREATE_BY" VARCHAR2(20 BYTE) NOT NULL ENABLE, 
	"LAST_EDIT_DATE" TIMESTAMP (6) NOT NULL ENABLE, 
	"LAST_EDIT_BY" VARCHAR2(20 BYTE) NOT NULL ENABLE, 
	"MP_ID" NUMBER(10,0), 
	"RM_COST_RATE_TYPE" NUMBER(2,0), 
	"RM_BOTTOM_TOTAL" NUMBER(10,0), 
	"RM_BOTTOM_NEEDLE" NUMBER(10,0), 
	"RM_BOTTOM_SMOOTH" NUMBER(10,0), 
	"RM_BOTTOM_VALE" NUMBER(10,0), 
	"RM_BOTTOM_APEX" NUMBER(10,0), 
	"RM_COLLECTOR_ID" VARCHAR2(12 BYTE), 
	"RM_VOL" NUMBER(10,4), 
	"RM_LN_NO" NUMBER(10,0), 
	"RM_GP_NO" NUMBER(10,0), 
	"RM_PAY_METHOD" NUMBER(2,0), 
	"RM_CHOOSE_COPY" NUMBER(2,0), 
	"RM_COST_RATE_OBJECT" NUMBER(2,0), 
	"RM_PHASE_TYPE" NUMBER(2,0), 
	"RM_SHUT_OFF" NUMBER(2,0), 
	"RM_CONNECT_TYPE" NUMBER(2,0), 
	"RM_TA_ID" NUMBER(10,0), 
	"RM_TV_ID" NUMBER(10,0), 
	 CONSTRAINT "RM_PK" PRIMARY KEY ("ID")
  USING INDEX PCTFREE 10 INITRANS 2 MAXTRANS 255 COMPUTE STATISTICS 
  STORAGE(INITIAL 65536 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645
  PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1 BUFFER_POOL DEFAULT)
  TABLESPACE "EISP"  ENABLE, 
	 CONSTRAINT "RM_C_FK" FOREIGN KEY ("CON_ID")
	  REFERENCES "EISP"."T_CONCENTRATOR" ("ID") ON DELETE CASCADE ENABLE, 
	 CONSTRAINT "RM_G_FK" FOREIGN KEY ("GROUP_ID")
	  REFERENCES "EISP"."T_GROUP" ("ID") ENABLE, 
	 CONSTRAINT "RM_TA_TV_FK" FOREIGN KEY ("RM_TA_ID")
	  REFERENCES "EISP"."T_TA_TV" ("ID") ENABLE, 
	 CONSTRAINT "RM_TA_TV_FK1" FOREIGN KEY ("RM_TV_ID")
	  REFERENCES "EISP"."T_TA_TV" ("ID") ENABLE, 
	 CONSTRAINT "R_RM_FK" FOREIGN KEY ("RESIDENT_ID")
	  REFERENCES "EISP"."T_RESIDENT" ("ID") ENABLE
   ) PCTFREE 10 PCTUSED 40 INITRANS 1 MAXTRANS 255 NOCOMPRESS LOGGING
  STORAGE(INITIAL 65536 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645
  PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1 BUFFER_POOL DEFAULT)
  TABLESPACE "EISP" ;
 

   COMMENT ON COLUMN "EISP"."T_RESIDENT_METER"."RESIDENT_ID" IS '居民ID';
 
   COMMENT ON COLUMN "EISP"."T_RESIDENT_METER"."GROUP_ID" IS '台区id';
 
   COMMENT ON COLUMN "EISP"."T_RESIDENT_METER"."CON_ID" IS '集中器id';
 
   COMMENT ON COLUMN "EISP"."T_RESIDENT_METER"."RM_ID" IS '表编号';
 
   COMMENT ON COLUMN "EISP"."T_RESIDENT_METER"."RM_NAME" IS '表名称';
 
   COMMENT ON COLUMN "EISP"."T_RESIDENT_METER"."RM_NO" IS '表序号';
 
   COMMENT ON COLUMN "EISP"."T_RESIDENT_METER"."RM_TYPE" IS '电表类型
:0:普通485表
1:载波表
2:简易多功能表
3:多功能总表
4:中继器';
 
   COMMENT ON COLUMN "EISP"."T_RESIDENT_METER"."RM_ASSET_NO" IS '资产号';
 
   COMMENT ON COLUMN "EISP"."T_RESIDENT_METER"."RM_LOGIC_ADDR" IS '表计逻辑地址';
 
   COMMENT ON COLUMN "EISP"."T_RESIDENT_METER"."RM_IS_EMPHASES" IS '是否是重点用户（0: 不是 1： 是）';
 
   COMMENT ON COLUMN "EISP"."T_RESIDENT_METER"."RM_PRECISION" IS '精度';
 
   COMMENT ON COLUMN "EISP"."T_RESIDENT_METER"."RM_MEASURE" IS '量程';
 
   COMMENT ON COLUMN "EISP"."T_RESIDENT_METER"."RM_CONSTANT" IS '电表常数';
 
   COMMENT ON COLUMN "EISP"."T_RESIDENT_METER"."RM_MAKE" IS '生产厂家';
 
   COMMENT ON COLUMN "EISP"."T_RESIDENT_METER"."RM_MAKE_NO" IS '出厂编号';
 
   COMMENT ON COLUMN "EISP"."T_RESIDENT_METER"."RM_MAKE_DATE" IS '出厂日期';
 
   COMMENT ON COLUMN "EISP"."T_RESIDENT_METER"."RM_PASSWORD_H" IS '电表密码
密码（密级_高）';
 
   COMMENT ON COLUMN "EISP"."T_RESIDENT_METER"."RM_PASSWORD_M" IS '电表密码
密码（密级_Z）';
 
   COMMENT ON COLUMN "EISP"."T_RESIDENT_METER"."RM_PASSWORD_L" IS '电表密码
密码（密级_D）';
 
   COMMENT ON COLUMN "EISP"."T_RESIDENT_METER"."RM_TYPE_NO" IS '型号（设备型号）';
 
   COMMENT ON COLUMN "EISP"."T_RESIDENT_METER"."RM_STANDARD" IS ' 电表规格';
 
   COMMENT ON COLUMN "EISP"."T_RESIDENT_METER"."RM_CONSUMER_TYPE" IS '用电类型';
 
   COMMENT ON COLUMN "EISP"."T_RESIDENT_METER"."RM_CONNECT_METHOD" IS '通断电方式';
 
   COMMENT ON COLUMN "EISP"."T_RESIDENT_METER"."RM_CUT_STATUS" IS '通断电状态';
 
   COMMENT ON COLUMN "EISP"."T_RESIDENT_METER"."RM_BAUD_RATE" IS ' 波特率';
 
   COMMENT ON COLUMN "EISP"."T_RESIDENT_METER"."RM_UVW_TYPE" IS '相别（0：不确定；1：A，2：B，3：C）';
 
   COMMENT ON COLUMN "EISP"."T_RESIDENT_METER"."RM_COMM_METHOD" IS '通讯方式';
 
   COMMENT ON COLUMN "EISP"."T_RESIDENT_METER"."RM_AMP" IS '安培数';
 
   COMMENT ON COLUMN "EISP"."T_RESIDENT_METER"."RM_OFF" IS '停用状态  （0: 停用 1：不停用）';
 
   COMMENT ON COLUMN "EISP"."T_RESIDENT_METER"."RM_INSTALL_DATE" IS '安装日期';
 
   COMMENT ON COLUMN "EISP"."T_RESIDENT_METER"."RM_ENABLED_DATE" IS '起效时间';
 
   COMMENT ON COLUMN "EISP"."T_RESIDENT_METER"."RM_DISABLED_DATE" IS '失效时间';
 
   COMMENT ON COLUMN "EISP"."T_RESIDENT_METER"."MP_ID" IS '测量点编号';
 
   COMMENT ON COLUMN "EISP"."T_RESIDENT_METER"."RM_COST_RATE_TYPE" IS '费率类型（单费率、复费率）';
 
   COMMENT ON COLUMN "EISP"."T_RESIDENT_METER"."RM_BOTTOM_TOTAL" IS '底数（总）';
 
   COMMENT ON COLUMN "EISP"."T_RESIDENT_METER"."RM_BOTTOM_NEEDLE" IS '底数（尖）';
 
   COMMENT ON COLUMN "EISP"."T_RESIDENT_METER"."RM_BOTTOM_SMOOTH" IS '底数（平）';
 
   COMMENT ON COLUMN "EISP"."T_RESIDENT_METER"."RM_BOTTOM_VALE" IS '底数（谷）';
 
   COMMENT ON COLUMN "EISP"."T_RESIDENT_METER"."RM_BOTTOM_APEX" IS '底数（峰）';
 
   COMMENT ON COLUMN "EISP"."T_RESIDENT_METER"."RM_COLLECTOR_ID" IS '采集器ID';
 
   COMMENT ON COLUMN "EISP"."T_RESIDENT_METER"."RM_VOL" IS '额定电压';
 
   COMMENT ON COLUMN "EISP"."T_RESIDENT_METER"."RM_LN_NO" IS '线路编号';
 
   COMMENT ON COLUMN "EISP"."T_RESIDENT_METER"."RM_GP_NO" IS '表箱编号';
 
   COMMENT ON COLUMN "EISP"."T_RESIDENT_METER"."RM_PAY_METHOD" IS '0:预付电量表 1:预付费表 2:非预付费（电量）表';
 
   COMMENT ON COLUMN "EISP"."T_RESIDENT_METER"."RM_CHOOSE_COPY" IS '是否选抄 1:选抄，0:不选抄';
 
   COMMENT ON COLUMN "EISP"."T_RESIDENT_METER"."RM_COST_RATE_OBJECT" IS '费率对象  0:对应总电量 1:保留 2: 对应总、1、2电量  3:对应总、1、2、3电量 4:对应总、1、2、3、4电量';
 
   COMMENT ON COLUMN "EISP"."T_RESIDENT_METER"."RM_PHASE_TYPE" IS '电表相数： 0：单相表，1：表示三相表';
 
   COMMENT ON COLUMN "EISP"."T_RESIDENT_METER"."RM_SHUT_OFF" IS '是否允许拉闸： 1:允许 0： 不允许';
 
   COMMENT ON COLUMN "EISP"."T_RESIDENT_METER"."RM_CONNECT_TYPE" IS '接入方式 :0: 直接接线，1: 表示经互感器接线。';
 
   COMMENT ON TABLE "EISP"."T_RESIDENT_METER"  IS 'T_RESIDENT_METER';
 

  CREATE OR REPLACE TRIGGER "EISP"."T_RESIDENT_METER_TG" 
  before insert on T_RESIDENT_METER
  for each row
begin
   SELECT nvl(max(id),1) + 50000000  INTO :NEW.mp_id FROM T_RESIDENT_METER;

end T_RESIDENT_METER_TG;

/
ALTER TRIGGER "EISP"."T_RESIDENT_METER_TG" ENABLE;
 

  CREATE TABLE "EISP"."T_ROLE_DATA" 
   (	"ID" NUMBER(10,0) NOT NULL ENABLE, 
	"RD_NAME" VARCHAR2(50 BYTE), 
	"RD_REMARK" VARCHAR2(100 BYTE), 
	"CREATE_DATE" TIMESTAMP (6) NOT NULL ENABLE, 
	"CREATE_BY" VARCHAR2(20 BYTE) NOT NULL ENABLE, 
	"LAST_EDIT_DATE" TIMESTAMP (6) NOT NULL ENABLE, 
	"LAST_EDIT_BY" VARCHAR2(20 BYTE) NOT NULL ENABLE, 
	 CONSTRAINT "T_ROLE_DATA_PK" PRIMARY KEY ("ID")
  USING INDEX PCTFREE 10 INITRANS 2 MAXTRANS 255 COMPUTE STATISTICS 
  STORAGE(INITIAL 65536 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645
  PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1 BUFFER_POOL DEFAULT)
  TABLESPACE "EISP"  ENABLE
   ) PCTFREE 10 PCTUSED 40 INITRANS 1 MAXTRANS 255 NOCOMPRESS LOGGING
  STORAGE(INITIAL 65536 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645
  PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1 BUFFER_POOL DEFAULT)
  TABLESPACE "EISP" ;
 

  CREATE TABLE "EISP"."T_ROLE_FUNCTION" 
   (	"ID" NUMBER(10,0) NOT NULL ENABLE, 
	"RF_NAME" VARCHAR2(100 BYTE), 
	"RF_REMARK" VARCHAR2(100 BYTE), 
	"RF_MODELS" VARCHAR2(1000 BYTE), 
	"CREATE_DATE" TIMESTAMP (6) NOT NULL ENABLE, 
	"CREATE_BY" VARCHAR2(20 BYTE) NOT NULL ENABLE, 
	"LAST_EDIT_DATE" TIMESTAMP (6) NOT NULL ENABLE, 
	"LAST_EDIT_BY" VARCHAR2(20 BYTE) NOT NULL ENABLE, 
	 CONSTRAINT "RF_PK" PRIMARY KEY ("ID")
  USING INDEX PCTFREE 10 INITRANS 2 MAXTRANS 255 COMPUTE STATISTICS 
  STORAGE(INITIAL 65536 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645
  PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1 BUFFER_POOL DEFAULT)
  TABLESPACE "EISP"  ENABLE
   ) PCTFREE 10 PCTUSED 40 INITRANS 1 MAXTRANS 255 NOCOMPRESS LOGGING
  STORAGE(INITIAL 65536 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645
  PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1 BUFFER_POOL DEFAULT)
  TABLESPACE "EISP" ;
 

   COMMENT ON COLUMN "EISP"."T_ROLE_FUNCTION"."RF_MODELS" IS '角色所赋有的操作模快权限（多选列表）(a,y,x,)';
 

  CREATE TABLE "EISP"."T_SUBSTATION_RELATION" 
   (	"ID" NUMBER(10,0) NOT NULL ENABLE, 
	"PARENT_ID" NUMBER(10,0), 
	"TYPE" VARCHAR2(2 BYTE) NOT NULL ENABLE, 
	"RELATE_NODE_ID" NUMBER(10,0), 
	"NAME" VARCHAR2(100 BYTE), 
	 CONSTRAINT "SR_PK" PRIMARY KEY ("ID")
  USING INDEX PCTFREE 10 INITRANS 2 MAXTRANS 255 COMPUTE STATISTICS 
  STORAGE(INITIAL 65536 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645
  PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1 BUFFER_POOL DEFAULT)
  TABLESPACE "EISP"  ENABLE, 
	 CONSTRAINT "SR_UNIQUE" UNIQUE ("TYPE", "RELATE_NODE_ID")
  USING INDEX PCTFREE 10 INITRANS 2 MAXTRANS 255 COMPUTE STATISTICS 
  STORAGE(INITIAL 65536 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645
  PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1 BUFFER_POOL DEFAULT)
  TABLESPACE "EISP"  ENABLE, 
	 CONSTRAINT "SR_SR_FK" FOREIGN KEY ("PARENT_ID")
	  REFERENCES "EISP"."T_SUBSTATION_RELATION" ("ID") ENABLE
   ) PCTFREE 10 PCTUSED 40 INITRANS 1 MAXTRANS 255 NOCOMPRESS LOGGING
  STORAGE(INITIAL 65536 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645
  PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1 BUFFER_POOL DEFAULT)
  TABLESPACE "EISP" ;
 

   COMMENT ON COLUMN "EISP"."T_SUBSTATION_RELATION"."TYPE" IS '类型
1：变电站
2：馈线
3：公变
4：专变
5：扩展
6：扩展
7：扩展
8：扩展';
 
   COMMENT ON COLUMN "EISP"."T_SUBSTATION_RELATION"."RELATE_NODE_ID" IS '关联节点id(变电站/馈线/公变等记录的id) ';
 
   COMMENT ON TABLE "EISP"."T_SUBSTATION_RELATION"  IS '变电站、变压器（公变、专变等），馈线树型结构关系表';
 

  CREATE UNIQUE INDEX "EISP"."SR_PK" ON "EISP"."T_SUBSTATION_RELATION" ("ID") 
  PCTFREE 10 INITRANS 2 MAXTRANS 255 COMPUTE STATISTICS 
  STORAGE(INITIAL 65536 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645
  PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1 BUFFER_POOL DEFAULT)
  TABLESPACE "EISP" ;
 
  CREATE UNIQUE INDEX "EISP"."SR_UNIQUE" ON "EISP"."T_SUBSTATION_RELATION" ("TYPE", "RELATE_NODE_ID") 
  PCTFREE 10 INITRANS 2 MAXTRANS 255 COMPUTE STATISTICS 
  STORAGE(INITIAL 65536 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645
  PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1 BUFFER_POOL DEFAULT)
  TABLESPACE "EISP" ;
 

  CREATE TABLE "EISP"."T_TA_TV" 
   (	"ID" NUMBER(10,0) NOT NULL ENABLE, 
	"TYPE" VARCHAR2(2 BYTE), 
	"VALUE" NUMBER(10,2), 
	"DESCRIPTION" VARCHAR2(32 BYTE), 
	 CONSTRAINT "T_TA_TV_PK" PRIMARY KEY ("ID")
  USING INDEX PCTFREE 10 INITRANS 2 MAXTRANS 255 COMPUTE STATISTICS 
  STORAGE(INITIAL 65536 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645
  PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1 BUFFER_POOL DEFAULT)
  TABLESPACE "EISP"  ENABLE
   ) PCTFREE 10 PCTUSED 40 INITRANS 1 MAXTRANS 255 NOCOMPRESS LOGGING
  STORAGE(INITIAL 65536 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645
  PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1 BUFFER_POOL DEFAULT)
  TABLESPACE "EISP" ;
 

   COMMENT ON COLUMN "EISP"."T_TA_TV"."TYPE" IS '0:TA
1:TV';
 

  CREATE TABLE "EISP"."T_TERMINAL" 
   (	"ID" NUMBER(10,0) NOT NULL ENABLE, 
	"T_ID" NUMBER(10,0), 
	"GROUP_ID" NUMBER(10,0), 
	"T_TYPE" VARCHAR2(2 BYTE), 
	"T_ASSET_NO" VARCHAR2(20 BYTE), 
	"T_RUN_STATE" VARCHAR2(2 BYTE), 
	"T_LAST_ON_DATE" TIMESTAMP (6), 
	"T_IP" VARCHAR2(20 BYTE), 
	"T_PORT" VARCHAR2(20 BYTE), 
	"T_COMM_METHOD" VARCHAR2(2 BYTE), 
	"T_MAKE" VARCHAR2(2 BYTE), 
	"CREATE_DATE" TIMESTAMP (6) NOT NULL ENABLE, 
	"CREATE_BY" VARCHAR2(20 BYTE) NOT NULL ENABLE, 
	"LAST_EDIT_DATE" TIMESTAMP (6) NOT NULL ENABLE, 
	"LAST_EDIT_BY" VARCHAR2(20 BYTE) NOT NULL ENABLE, 
	 CONSTRAINT "T_TERMINAL_PK" PRIMARY KEY ("ID")
  USING INDEX PCTFREE 10 INITRANS 2 MAXTRANS 255 COMPUTE STATISTICS 
  STORAGE(INITIAL 65536 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645
  PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1 BUFFER_POOL DEFAULT)
  TABLESPACE "EISP"  ENABLE, 
	 CONSTRAINT "T_G_FK1" FOREIGN KEY ("GROUP_ID")
	  REFERENCES "EISP"."T_GROUP" ("ID") ENABLE
   ) PCTFREE 10 PCTUSED 40 INITRANS 1 MAXTRANS 255 NOCOMPRESS LOGGING
  STORAGE(INITIAL 65536 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645
  PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1 BUFFER_POOL DEFAULT)
  TABLESPACE "EISP" ;
 

   COMMENT ON COLUMN "EISP"."T_TERMINAL"."T_ID" IS '关联终端设备ID';
 
   COMMENT ON COLUMN "EISP"."T_TERMINAL"."T_TYPE" IS '终端类型';
 
   COMMENT ON COLUMN "EISP"."T_TERMINAL"."T_ASSET_NO" IS '资产号';
 
   COMMENT ON COLUMN "EISP"."T_TERMINAL"."T_RUN_STATE" IS '运行状态';
 
   COMMENT ON COLUMN "EISP"."T_TERMINAL"."T_LAST_ON_DATE" IS '最后上线时间';
 
   COMMENT ON COLUMN "EISP"."T_TERMINAL"."T_COMM_METHOD" IS '通讯方式（属性文件）';
 
   COMMENT ON COLUMN "EISP"."T_TERMINAL"."T_MAKE" IS '生产厂家（属性文件）';
 
   COMMENT ON TABLE "EISP"."T_TERMINAL"  IS '终端表';
 

  CREATE TABLE "EISP"."T_TRANFORMER_SUBSTATION" 
   (	"ID" NUMBER(10,0) NOT NULL ENABLE, 
	"GROUP_ID" NUMBER(10,0), 
	"NAME" VARCHAR2(100 BYTE), 
	"VOLTAGE_GRADE" VARCHAR2(2 BYTE), 
	"ADDRESS" VARCHAR2(100 BYTE), 
	"PHONE" VARCHAR2(20 BYTE), 
	"POST_NO" VARCHAR2(10 BYTE), 
	"FAX" VARCHAR2(20 BYTE), 
	"LINKMAN" VARCHAR2(10 BYTE), 
	"MOBILE" VARCHAR2(20 BYTE), 
	"CREATE_DATE" TIMESTAMP (6), 
	"CREATE_BY" VARCHAR2(32 BYTE), 
	"LAST_EDIT_DATE" TIMESTAMP (6), 
	"LAST_EDIT_BY" VARCHAR2(20 BYTE), 
	 CONSTRAINT "TS_PK" PRIMARY KEY ("ID")
  USING INDEX PCTFREE 10 INITRANS 2 MAXTRANS 255 COMPUTE STATISTICS 
  STORAGE(INITIAL 65536 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645
  PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1 BUFFER_POOL DEFAULT)
  TABLESPACE "EISP"  ENABLE, 
	 CONSTRAINT "TS_G_FK" FOREIGN KEY ("GROUP_ID")
	  REFERENCES "EISP"."T_GROUP" ("ID") ENABLE
   ) PCTFREE 10 PCTUSED 40 INITRANS 1 MAXTRANS 255 NOCOMPRESS LOGGING
  STORAGE(INITIAL 65536 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645
  PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1 BUFFER_POOL DEFAULT)
  TABLESPACE "EISP" ;
 

   COMMENT ON COLUMN "EISP"."T_TRANFORMER_SUBSTATION"."GROUP_ID" IS '所属分区';
 
   COMMENT ON COLUMN "EISP"."T_TRANFORMER_SUBSTATION"."NAME" IS '变电站名称';
 
   COMMENT ON COLUMN "EISP"."T_TRANFORMER_SUBSTATION"."VOLTAGE_GRADE" IS '电压等级';
 
   COMMENT ON COLUMN "EISP"."T_TRANFORMER_SUBSTATION"."ADDRESS" IS '地址';
 
   COMMENT ON COLUMN "EISP"."T_TRANFORMER_SUBSTATION"."PHONE" IS '电话';
 
   COMMENT ON COLUMN "EISP"."T_TRANFORMER_SUBSTATION"."POST_NO" IS '邮编';
 
   COMMENT ON COLUMN "EISP"."T_TRANFORMER_SUBSTATION"."FAX" IS '传真';
 
   COMMENT ON COLUMN "EISP"."T_TRANFORMER_SUBSTATION"."LINKMAN" IS '联系人';
 
   COMMENT ON COLUMN "EISP"."T_TRANFORMER_SUBSTATION"."MOBILE" IS '手机';
 
   COMMENT ON TABLE "EISP"."T_TRANFORMER_SUBSTATION"  IS '变电站表';
 

  CREATE TABLE "EISP"."T_USER" 
   (	"ID" NUMBER(10,0) NOT NULL ENABLE, 
	"U_NAME" VARCHAR2(20 BYTE), 
	"U_PASSWORD" VARCHAR2(100 BYTE), 
	"CREATE_DATE" TIMESTAMP (6) NOT NULL ENABLE, 
	"CREATE_BY" VARCHAR2(20 BYTE) NOT NULL ENABLE, 
	"LAST_EDIT_DATE" TIMESTAMP (6) NOT NULL ENABLE, 
	"LAST_EDIT_BY" VARCHAR2(20 BYTE) NOT NULL ENABLE, 
	 CONSTRAINT "T_USER_PK" PRIMARY KEY ("ID")
  USING INDEX PCTFREE 10 INITRANS 2 MAXTRANS 255 COMPUTE STATISTICS 
  STORAGE(INITIAL 65536 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645
  PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1 BUFFER_POOL DEFAULT)
  TABLESPACE "EISP"  ENABLE
   ) PCTFREE 10 PCTUSED 40 INITRANS 1 MAXTRANS 255 NOCOMPRESS LOGGING
  STORAGE(INITIAL 65536 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645
  PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1 BUFFER_POOL DEFAULT)
  TABLESPACE "EISP" ;
 

   COMMENT ON COLUMN "EISP"."T_USER"."U_NAME" IS '真实姓名';
 

  CREATE OR REPLACE TRIGGER "EISP"."T_LV_FREEZE_GEN_EXTREMUM_TG" 
  before insert on T_USER
  for each row
begin
   SELECT T_LV_FREEZE_GEN_EXTREMUM_SEQ.NEXTVAL INTO :NEW.id FROM DUAL;
end T_LV_FREEZE_GEN_EXTREMUM_TG;


/
ALTER TRIGGER "EISP"."T_LV_FREEZE_GEN_EXTREMUM_TG" ENABLE;
 

  CREATE OR REPLACE TRIGGER "EISP"."T_LV_FREEZE_GEN_TG" 
  before insert on T_USER
  for each row
begin
   SELECT T_LV_FREEZE_GEN_SEQ.NEXTVAL INTO :NEW.id FROM DUAL;
end T_LV_FREEZE_GEN_TG;


/
ALTER TRIGGER "EISP"."T_LV_FREEZE_GEN_TG" ENABLE;
 

  CREATE OR REPLACE TRIGGER "EISP"."T_LV_FREEZE_PLOAD_TG" 
  before insert on T_USER
  for each row
begin
   SELECT T_LV_FREEZE_PLOAD_SEQ.NEXTVAL INTO :NEW.id FROM DUAL;
end T_LV_FREEZE_PLOAD_TG;


/
ALTER TRIGGER "EISP"."T_LV_FREEZE_PLOAD_TG" ENABLE;
 

  CREATE OR REPLACE TRIGGER "EISP"."T_MAX_NEED_TG" 
  before insert on T_USER
  for each row
begin
   SELECT T_MAX_NEED_SEQ.NEXTVAL INTO :NEW.id FROM DUAL;
end T_MAX_NEED_TG;


/
ALTER TRIGGER "EISP"."T_MAX_NEED_TG" ENABLE;
 

  CREATE TABLE "EISP"."T_USER_DETAIL" 
   (	"USER_ID" NUMBER(10,0) NOT NULL ENABLE, 
	"DEPM_ID" NUMBER(10,0), 
	"U_REALNAME" VARCHAR2(20 BYTE), 
	"UD_MOBILE" VARCHAR2(20 BYTE), 
	"UD_OFFICE_TEL" VARCHAR2(20 BYTE), 
	"UD_HOME_TEL" VARCHAR2(20 BYTE), 
	"UD_ADDR" VARCHAR2(100 BYTE), 
	"UD_EMAIL" VARCHAR2(50 BYTE), 
	"UD_REMARK" VARCHAR2(100 BYTE), 
	"CREATE_DATE" TIMESTAMP (6) NOT NULL ENABLE, 
	"CREATE_BY" VARCHAR2(20 BYTE) NOT NULL ENABLE, 
	"LAST_EDIT_DATE" TIMESTAMP (6) NOT NULL ENABLE, 
	"LAST_EDIT_BY" VARCHAR2(20 BYTE) NOT NULL ENABLE, 
	 CONSTRAINT "T_USER_DETAIL_PK" PRIMARY KEY ("USER_ID")
  USING INDEX PCTFREE 10 INITRANS 2 MAXTRANS 255 COMPUTE STATISTICS 
  STORAGE(INITIAL 65536 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645
  PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1 BUFFER_POOL DEFAULT)
  TABLESPACE "EISP"  ENABLE, 
	 CONSTRAINT "UD_G_FK" FOREIGN KEY ("DEPM_ID")
	  REFERENCES "EISP"."T_GROUP" ("ID") ENABLE, 
	 CONSTRAINT "U_UD_FK" FOREIGN KEY ("USER_ID")
	  REFERENCES "EISP"."T_USER" ("ID") ENABLE
   ) PCTFREE 10 PCTUSED 40 INITRANS 1 MAXTRANS 255 NOCOMPRESS LOGGING
  STORAGE(INITIAL 65536 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645
  PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1 BUFFER_POOL DEFAULT)
  TABLESPACE "EISP" ;
 

  CREATE TABLE "EISP"."T_USER_ROLE_DATA" 
   (	"RD_ID" NUMBER(10,0) NOT NULL ENABLE, 
	"USER_ID" NUMBER(10,0) NOT NULL ENABLE, 
	"ID" NUMBER(10,0) NOT NULL ENABLE, 
	 CONSTRAINT "URD_USER_ID_UN" UNIQUE ("USER_ID")
  USING INDEX PCTFREE 10 INITRANS 2 MAXTRANS 255 COMPUTE STATISTICS 
  STORAGE(INITIAL 65536 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645
  PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1 BUFFER_POOL DEFAULT)
  TABLESPACE "EISP"  ENABLE, 
	 CONSTRAINT "RD_URD_FK" FOREIGN KEY ("RD_ID")
	  REFERENCES "EISP"."T_ROLE_DATA" ("ID") ENABLE, 
	 CONSTRAINT "URD_U_FK" FOREIGN KEY ("USER_ID")
	  REFERENCES "EISP"."T_USER" ("ID") ENABLE
   ) PCTFREE 10 PCTUSED 40 INITRANS 1 MAXTRANS 255 NOCOMPRESS LOGGING
  STORAGE(INITIAL 65536 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645
  PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1 BUFFER_POOL DEFAULT)
  TABLESPACE "EISP" ;
 

  CREATE UNIQUE INDEX "EISP"."URD_USER_ID_UN" ON "EISP"."T_USER_ROLE_DATA" ("USER_ID") 
  PCTFREE 10 INITRANS 2 MAXTRANS 255 COMPUTE STATISTICS 
  STORAGE(INITIAL 65536 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645
  PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1 BUFFER_POOL DEFAULT)
  TABLESPACE "EISP" ;
 

  CREATE TABLE "EISP"."T_USER_ROLE_FUNCTION" 
   (	"RF_ID" NUMBER(10,0) NOT NULL ENABLE, 
	"USER_ID" NUMBER(10,0) NOT NULL ENABLE, 
	"ID" NUMBER(10,0) NOT NULL ENABLE, 
	 CONSTRAINT "URF_USER_ID_UN" UNIQUE ("USER_ID")
  USING INDEX PCTFREE 10 INITRANS 2 MAXTRANS 255 COMPUTE STATISTICS 
  STORAGE(INITIAL 65536 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645
  PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1 BUFFER_POOL DEFAULT)
  TABLESPACE "EISP"  ENABLE, 
	 CONSTRAINT "RF_URF_FK" FOREIGN KEY ("RF_ID")
	  REFERENCES "EISP"."T_ROLE_FUNCTION" ("ID") ENABLE, 
	 CONSTRAINT "URF_U_FK" FOREIGN KEY ("USER_ID")
	  REFERENCES "EISP"."T_USER" ("ID") ENABLE
   ) PCTFREE 10 PCTUSED 40 INITRANS 1 MAXTRANS 255 NOCOMPRESS LOGGING
  STORAGE(INITIAL 65536 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645
  PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1 BUFFER_POOL DEFAULT)
  TABLESPACE "EISP" ;
 

  CREATE UNIQUE INDEX "EISP"."URF_USER_ID_UN" ON "EISP"."T_USER_ROLE_FUNCTION" ("USER_ID") 
  PCTFREE 10 INITRANS 2 MAXTRANS 255 COMPUTE STATISTICS 
  STORAGE(INITIAL 65536 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645
  PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1 BUFFER_POOL DEFAULT)
  TABLESPACE "EISP" ;
 
